예제 #1
0
        public async Task <bool> DeleteAuthorizationPermissionAsync(string realm, string clientId, AuthorizationPermissionType permissionType,
                                                                    string permissionId)
        {
            var response = await GetBaseUrl(realm)
                           .AppendPathSegment($"/admin/realms/{realm}/clients/{clientId}/authz/resource-server/permission")
                           .AppendPathSegment(permissionType == AuthorizationPermissionType.Scope ? "/scope" : "/resource")
                           .AppendPathSegment($"/{permissionId}")
                           .DeleteAsync()
                           .ConfigureAwait(false);

            return(response.IsSuccessStatusCode);
        }
예제 #2
0
 public async Task <AuthorizationPermission> GetAuthorizationPermissionByIdAsync(string realm, string clientId,
                                                                                 AuthorizationPermissionType permissionType, string permissionId) => await GetBaseUrl(realm)
 .AppendPathSegment($"/admin/realms/{realm}/clients/{clientId}/authz/resource-server/permission")
 .AppendPathSegment(permissionType == AuthorizationPermissionType.Scope ? "/scope" : "/resource")
 .AppendPathSegment($"/{permissionId}")
 .GetJsonAsync <AuthorizationPermission>()
 .ConfigureAwait(false);