Skip to content
This repository has been archived by the owner on Sep 18, 2021. It is now read-only.

Commit

Permalink
add extension method to dynamically obtain the issuer URI
Browse files Browse the repository at this point in the history
  • Loading branch information
brockallen committed Sep 6, 2015
1 parent 9a2a93e commit a6e2b6b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions source/Core/Extensions/InternalOwinExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,22 @@ public static string GetIdentityServerBaseUrl(this IOwinContext context)
return context.Environment.GetIdentityServerBaseUrl();
}

public static string GetIdentityServerIssuerUri(this IOwinContext context)
{
if (context == null) throw new ArgumentNullException("context");

var options = context.ResolveDependency<IdentityServerOptions>();

var uri = options.IssuerUri;
if (String.IsNullOrWhiteSpace(uri))
{
uri = context.GetIdentityServerBaseUrl();
if (uri.EndsWith("/")) uri = uri.Substring(0, uri.Length - 1);
}

return uri;
}

public static string GetIdentityServerLogoutUrl(this IOwinContext context)
{
if (context == null) throw new ArgumentNullException("context");
Expand Down

0 comments on commit a6e2b6b

Please sign in to comment.