Skip to content

Commit

Permalink
FIX: Using only ClientId instead of use Resource
Browse files Browse the repository at this point in the history
  • Loading branch information
Felipe Mattioli dos Santos committed Jul 10, 2024
1 parent 60647ab commit b8d7a02
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static IServiceCollection AddKeyCloakAuth(this IServiceCollection service
.AddKeycloakWebApi(
options =>
{
options.Resource = authSettings.Resource!;
options.Resource = authSettings.ClientId;
options.AuthServerUrl = authSettings.AuthServerUrl;
options.VerifyTokenAudience = true;
},
Expand Down Expand Up @@ -130,7 +130,7 @@ public static IServiceCollection AddKeyCloakAuth(this IServiceCollection service
policy =>
{
policy.RequireResourceRolesForClient(
authSettings.Resource!,
authSettings.ClientId,
authSettings.Roles!.ToArray());
}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ public class AuthSettings
{
public required string ClientId { get; set; }
public required string ClientSecret { get; set; }
public required string Resource { get; set; }
public required string AuthServerUrl { get; set; }
public required IEnumerable<Realm> Realms { get; set; }
public string? PolicyName { get; set; }
Expand Down

0 comments on commit b8d7a02

Please sign in to comment.