Skip to content

Commit

Permalink
fix: Fix relative Urls for SDK clients (#158)
Browse files Browse the repository at this point in the history
  • Loading branch information
NikiforovAll authored Nov 30, 2024
1 parent 876cfd9 commit 943115f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions docs-reference
Submodule docs-reference added at c21821
4 changes: 2 additions & 2 deletions src/Keycloak.AuthServices.Sdk/Protection/ApiUrls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Keycloak.AuthServices.Sdk.Protection;
internal static class ApiUrls
{
#region ProtectedResource
internal const string GetResources = "/realms/{realm}/authz/protection/resource_set";
internal const string GetResources = "realms/{realm}/authz/protection/resource_set";

internal const string GetResource = $"{GetResources}/{{id}}";

Expand All @@ -18,7 +18,7 @@ internal static class ApiUrls
#endregion

#region Policy
internal const string GetPolicies = "/realms/{realm}/authz/protection/uma-policy";
internal const string GetPolicies = "realms/{realm}/authz/protection/uma-policy";

internal const string GetPolicy = $"{GetPolicies}/{{id}}";

Expand Down
4 changes: 2 additions & 2 deletions src/Keycloak.AuthServices.Sdk/ServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static IHttpClientBuilder AddKeycloakAdminHttpClient(
IOptions<KeycloakAdminClientOptions>
>();

http.BaseAddress = new Uri(keycloakOptions.Value.KeycloakUrlRealm);
http.BaseAddress = new Uri(keycloakOptions.Value.AuthServerUrl!);
configureClient?.Invoke(http);
}
)
Expand Down Expand Up @@ -178,7 +178,7 @@ public static IHttpClientBuilder AddKeycloakProtectionHttpClient(
IOptions<KeycloakProtectionClientOptions>
>();

http.BaseAddress = new Uri(keycloakOptions.Value.KeycloakUrlRealm);
http.BaseAddress = new Uri(keycloakOptions.Value.AuthServerUrl!);
configureClient?.Invoke(http);
}
)
Expand Down

0 comments on commit 943115f

Please sign in to comment.