Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

353928: backstage auth rework #65

Merged
merged 2 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions .azuredevops/containerApp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ properties:
keyVaultUrl: https://{{appKeyVaultName}}.vault.azure.net/secrets/BACKSTAGE-AUTHORITY
identity: {{userAssignedIdentity}}
- name: backstage-issuer
keyVaultUrl: https://{{appKeyVaultName}}.vault.azure.net/secrets/BACKSTAGE-ISSUER
identity: {{userAssignedIdentity}}
template:
containers:
- image: {{acrName}}.azurecr.io/image/{{imageRepoName}}:{{appVersion}}
Expand Down Expand Up @@ -116,10 +114,10 @@ properties:
value: {{userAssignedIdentity}}
- name: Authentication__backstage__Authority
secretRef: backstage-authority
- name: Authentication__backstage__TokenValidationParameters__ValidIssuer
secretRef: backstage-issuer
- name: Authentication__backstage__TokenValidationParameters__ValidAudience
value: backstage
- name: Authentication__backstage__TokenValidationParameters__ValidateIssuer
value: false
- name: Authentication__backstage__TokenValidationParameters__ValidateAudience
value: false
resources:
cpu: 0.5
memory: 1Gi
Expand Down
2 changes: 1 addition & 1 deletion src/ADP.Portal.Api/ADP.Portal.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Version>0.2.15</Version>
<Version>0.2.16</Version>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<InvariantGlobalization>true</InvariantGlobalization>
Expand Down
3 changes: 2 additions & 1 deletion src/ADP.Portal.Api/Controllers/GithubTeamsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
using ADP.Portal.Core.Git.Entities;
using ADP.Portal.Core.Git.Services;
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

namespace ADP.Portal.Api.Controllers;

[Route("api/github/teams")]
[ApiVersion("1.0")]
//[Authorize(AuthenticationSchemes = "backstage")]
[Authorize(AuthenticationSchemes = "backstage")]
[ApiController]
public class GithubTeamsController : ControllerBase
{
Expand Down
4 changes: 2 additions & 2 deletions src/ADP.Portal.Api/appsettings.Development.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
"RequireHttpsMetadata": false,
"Authority": "http://localhost:7007/api/auth/",
"TokenValidationParameters": {
"ValidAudience": "backstage",
"ValidIssuer": "http://localhost:7007/api/auth/"
"ValidateAudience": false,
"ValidateIssuer": false
}
}
}
Expand Down