Skip to content

Commit

Permalink
Ticket 202 : Invalidate the cache when a client is updated
Browse files Browse the repository at this point in the history
  • Loading branch information
thabart committed Sep 27, 2016
1 parent 8a89fb8 commit a634352
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ namespace {namespace}
private const string OpenIdConfigurationUrl = "https://localhost:5443/.well-known/openid-configuration";

#region Public static methods


/// <summary>
/// Get an identity token via the resource owner credentials workflow.
/// </summary>
/// <returns>JWS or JWE token</returns>
public static string GetIdentityToken()
{
var authProvider = new AuthenticationProviderFactory();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,20 @@
using SimpleIdentityServer.Proxy;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace {namespace}
{
public class SecurityProxy_{hash}
{
/// <summary>
/// Get an RPT token to access to a protected resource.
/// <see cref="https://docs.kantarainitiative.org/uma/rec-uma-core.html#uma-bearer-token-profile" /> for more information about the statement.
/// </summary>
/// <param name="umaProtectionToken">Token valid for the scope uma_protection</param>
/// <param name="umaAuthorizationToken">Token valid for the scope uma_authorization</param>
/// <param name="resourceToken">Token valid for the scope website_api</param>
/// <returns>An rpt token</returns>
public static async Task<string> GetRptToken(
string umaProtectionToken,
string umaAuthorizationToken,
Expand All @@ -42,12 +51,21 @@ namespace {namespace}
});
return result;
}
catch (Exception ex)
catch (Exception)
{
return null;
}
}


/// <summary>
/// Get an RPT token to access to a protected resource.
/// <see cref="https://docs.kantarainitiative.org/uma/rec-uma-core.html#uma-bearer-token-profile" /> for more information about the statement.
/// </summary>
/// <param name="idToken">JWS token used by the authorization policy</param>
/// <param name="umaProtectionToken">Token valid for the scope uma_protection</param>
/// <param name="umaAuthorizationToken">Token valid for the scope uma_authorization</param>
/// <param name="resourceToken">Token valid for the scope website_api</param>
/// <returns>An rpt token</returns>
public static async Task<string> GetRptToken(
string idToken,
string umaProtectionToken,
Expand All @@ -69,7 +87,7 @@ namespace {namespace}
});
return result;
}
catch (Exception ex)
catch (Exception)
{
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ public async Task<ActionResult> Put([FromBody] UpdateClientRequest updateClientR
}

await _representationManager.AddOrUpdateRepresentationAsync(this, GetClientStoreName + updateClientRequest.ClientId, false);
await _representationManager.AddOrUpdateRepresentationAsync(this, GetClientsStoreName, false);
return new NoContentResult();
}

Expand Down

0 comments on commit a634352

Please sign in to comment.