Browse Source

Introduce parameterless OpenIddictBuilder.EnableEndpoint() extensions

pull/190/head
Kévin Chalet 10 years ago
parent
commit
383b1e0f9c
  1. 60
      src/OpenIddict.Core/OpenIddictBuilder.cs
  2. 44
      src/OpenIddict.Core/OpenIddictDefaults.cs

60
src/OpenIddict.Core/OpenIddictBuilder.cs

@ -490,7 +490,15 @@ namespace Microsoft.AspNetCore.Builder {
} }
/// <summary> /// <summary>
/// Enables the authorization endpoint. /// Enables the authorization endpoint using the default endpoint path (/connect/authorize).
/// </summary>
/// <returns>The <see cref="OpenIddictBuilder"/>.</returns>
public virtual OpenIddictBuilder EnableAuthorizationEndpoint() {
return EnableAuthorizationEndpoint(OpenIddictDefaults.AuthorizationEndpointPath);
}
/// <summary>
/// Enables the authorization endpoint using the specified path.
/// </summary> /// </summary>
/// <param name="path">The relative path of the authorization endpoint.</param> /// <param name="path">The relative path of the authorization endpoint.</param>
/// <returns>The <see cref="OpenIddictBuilder"/>.</returns> /// <returns>The <see cref="OpenIddictBuilder"/>.</returns>
@ -499,7 +507,15 @@ namespace Microsoft.AspNetCore.Builder {
} }
/// <summary> /// <summary>
/// Enables the introspection endpoint. /// Enables the introspection endpoint using the default endpoint path (/connect/introspect).
/// </summary>
/// <returns>The <see cref="OpenIddictBuilder"/>.</returns>
public virtual OpenIddictBuilder EnableIntrospectionEndpoint() {
return EnableIntrospectionEndpoint(OpenIddictDefaults.IntrospectionEndpointPath);
}
/// <summary>
/// Enables the introspection endpoint using the specified path.
/// </summary> /// </summary>
/// <param name="path">The relative path of the logout endpoint.</param> /// <param name="path">The relative path of the logout endpoint.</param>
/// <returns>The <see cref="OpenIddictBuilder"/>.</returns> /// <returns>The <see cref="OpenIddictBuilder"/>.</returns>
@ -508,7 +524,15 @@ namespace Microsoft.AspNetCore.Builder {
} }
/// <summary> /// <summary>
/// Enables the logout endpoint. /// Enables the logout endpoint using the default endpoint path (/connect/logout).
/// </summary>
/// <returns>The <see cref="OpenIddictBuilder"/>.</returns>
public virtual OpenIddictBuilder EnableLogoutEndpoint() {
return EnableLogoutEndpoint(OpenIddictDefaults.LogoutEndpointPath);
}
/// <summary>
/// Enables the logout endpoint using the specified path.
/// </summary> /// </summary>
/// <param name="path">The relative path of the logout endpoint.</param> /// <param name="path">The relative path of the logout endpoint.</param>
/// <returns>The <see cref="OpenIddictBuilder"/>.</returns> /// <returns>The <see cref="OpenIddictBuilder"/>.</returns>
@ -517,7 +541,15 @@ namespace Microsoft.AspNetCore.Builder {
} }
/// <summary> /// <summary>
/// Enables the revocation endpoint. /// Enables the revocation endpoint using the default endpoint path (/connect/revoke).
/// </summary>
/// <returns>The <see cref="OpenIddictBuilder"/>.</returns>
public virtual OpenIddictBuilder EnableRevocationEndpoint() {
return EnableRevocationEndpoint(OpenIddictDefaults.RevocationEndpointPath);
}
/// <summary>
/// Enables the revocation endpoint using the specified path.
/// </summary> /// </summary>
/// <param name="path">The relative path of the revocation endpoint.</param> /// <param name="path">The relative path of the revocation endpoint.</param>
/// <returns>The <see cref="OpenIddictBuilder"/>.</returns> /// <returns>The <see cref="OpenIddictBuilder"/>.</returns>
@ -526,7 +558,15 @@ namespace Microsoft.AspNetCore.Builder {
} }
/// <summary> /// <summary>
/// Enables the token endpoint. /// Enables the token endpoint using the default endpoint path (/connect/token).
/// </summary>
/// <returns>The <see cref="OpenIddictBuilder"/>.</returns>
public virtual OpenIddictBuilder EnableTokenEndpoint() {
return EnableTokenEndpoint(OpenIddictDefaults.TokenEndpointPath);
}
/// <summary>
/// Enables the token endpoint using the specified path.
/// </summary> /// </summary>
/// <param name="path">The relative path of the token endpoint.</param> /// <param name="path">The relative path of the token endpoint.</param>
/// <returns>The <see cref="OpenIddictBuilder"/>.</returns> /// <returns>The <see cref="OpenIddictBuilder"/>.</returns>
@ -535,7 +575,15 @@ namespace Microsoft.AspNetCore.Builder {
} }
/// <summary> /// <summary>
/// Enables the userinfo endpoint. /// Enables the userinfo endpoint using the default endpoint path (/connect/userinfo).
/// </summary>
/// <returns>The <see cref="OpenIddictBuilder"/>.</returns>
public virtual OpenIddictBuilder EnableUserinfoEndpoint() {
return EnableUserinfoEndpoint(OpenIddictDefaults.UserinfoEndpointPath);
}
/// <summary>
/// Enables the userinfo endpoint using the specified path.
/// </summary> /// </summary>
/// <param name="path">The relative path of the userinfo endpoint.</param> /// <param name="path">The relative path of the userinfo endpoint.</param>
/// <returns>The <see cref="OpenIddictBuilder"/>.</returns> /// <returns>The <see cref="OpenIddictBuilder"/>.</returns>

44
src/OpenIddict.Core/OpenIddictDefaults.cs

@ -0,0 +1,44 @@
/*
* Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
* See https://github.com/openiddict/openiddict-core for more information concerning
* the license and the contributors participating to this project.
*/
using AspNet.Security.OpenIdConnect.Server;
namespace OpenIddict {
/// <summary>
/// Exposes the default values used by OpenIddict.
/// </summary>
public static class OpenIddictDefaults {
/// <summary>
/// Default value for <see cref="OpenIdConnectServerOptions.AuthorizationEndpointPath"/>.
/// </summary>
public const string AuthorizationEndpointPath = "/connect/authorize";
/// <summary>
/// Default value for <see cref="OpenIdConnectServerOptions.IntrospectionEndpointPath"/>.
/// </summary>
public const string IntrospectionEndpointPath = "/connect/introspect";
/// <summary>
/// Default value for <see cref="OpenIdConnectServerOptions.LogoutEndpointPath"/>.
/// </summary>
public const string LogoutEndpointPath = "/connect/logout";
/// <summary>
/// Default value for <see cref="OpenIdConnectServerOptions.RevocationEndpointPath"/>.
/// </summary>
public const string RevocationEndpointPath = "/connect/revoke";
/// <summary>
/// Default value for <see cref="OpenIdConnectServerOptions.TokenEndpointPath"/>.
/// </summary>
public const string TokenEndpointPath = "/connect/token";
/// <summary>
/// Default value for <see cref="OpenIdConnectServerOptions.UserinfoEndpointPath"/>.
/// </summary>
public const string UserinfoEndpointPath = "/connect/userinfo";
}
}
Loading…
Cancel
Save