Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Commit

Permalink
fix: config auth scope
Browse files Browse the repository at this point in the history
  • Loading branch information
foxminchan committed May 12, 2024
1 parent 75fe029 commit 1d6a2db
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/RookieShop.Domain/Constants/AuthScope.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ public static class AuthScope
{
public const string Read = nameof(Read);
public const string Write = nameof(Write);
public const string All = nameof(All);
}
13 changes: 6 additions & 7 deletions src/RookieShop.IdentityService/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ public static class Config
public static IEnumerable<ApiScope> ApiScopes =>
[
new(AuthScope.Read, "Read Access to API"),
new(AuthScope.Write, "Write Access to API")
new(AuthScope.Write, "Write Access to API"),
new(AuthScope.All, "Read and Write Access to API")
];

public static IEnumerable<ApiResource> ApiResources =>
Expand Down Expand Up @@ -63,15 +64,14 @@ public static class Config
ClientName = "Store Front",
ClientSecrets = { new("secret".Sha256()) },
AllowedGrantTypes = [GrantType.AuthorizationCode],
RedirectUris = { $"{configuration["Client:StoreFront"]}/api/auth/callback/duende-identity-service" },
RedirectUris = { $"{configuration["Client:StoreFront"]}/api/auth/callback/duende-identityserver6" },
PostLogoutRedirectUris = { $"{configuration["Client:StoreFront"]}" },
AllowedCorsOrigins = { $"{configuration["Client:StoreFront"]}" },
AllowedScopes =
{
IdentityServerConstants.StandardScopes.OpenId,
IdentityServerConstants.StandardScopes.Profile,
AuthScope.Read,
AuthScope.Write
AuthScope.All
}
},
new()
Expand All @@ -80,15 +80,14 @@ public static class Config
ClientName = "Back Office",
ClientSecrets = { new("secret".Sha256()) },
AllowedGrantTypes = [GrantType.AuthorizationCode],
RedirectUris = { $"{configuration["Client:BackOffice"]}/api/auth/callback/duende-identity-service" },
RedirectUris = { $"{configuration["Client:BackOffice"]}/api/auth/callback/duende-identityserver6" },
PostLogoutRedirectUris = { $"{configuration["Client:BackOffice"]}" },
AllowedCorsOrigins = { $"{configuration["Client:BackOffice"]}" },
AllowedScopes =
{
IdentityServerConstants.StandardScopes.OpenId,
IdentityServerConstants.StandardScopes.Profile,
AuthScope.Read,
AuthScope.Write
AuthScope.All
}
}
];
Expand Down

0 comments on commit 1d6a2db

Please sign in to comment.