-
-
Save weedkiller/213a205a039156994bfd9abf10f454e6 to your computer and use it in GitHub Desktop.
intuit1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public sealed class IntuitAuthenticationOptions : OpenIDAuthenticationOptions | |
{ | |
public const string FirstName = "intuit.firstname"; | |
public const string LastName = "intuit.lastname"; | |
public const string Email = "intuit.email"; | |
public IntuitAuthenticationOptions() | |
{ | |
ProviderDiscoveryUri = "https://openid.intuit.com/openid/xrds"; | |
Caption = "Intuit"; | |
AuthenticationType = "Intuit"; | |
CallbackPath = new PathString("/signin-intuit"); | |
} | |
} | |
public static class IntuitAuthenticationExtensions | |
{ | |
public static IAppBuilder UseIntuitAuthentication(this IAppBuilder app, IntuitAuthenticationOptions options) | |
{ | |
if (app == null) throw new ArgumentNullException("app"); | |
if (options == null) throw new ArgumentNullException("options"); | |
return app.Use(typeof(IntuitAuthenticationMiddleware), app, options); | |
} | |
public static IAppBuilder UseIntuitAuthentication(this IAppBuilder app) | |
{ | |
return UseIntuitAuthentication(app, new IntuitAuthenticationOptions()); | |
} | |
} | |
internal sealed class IntuitAuthenticationHandler : OpenIDAuthenticationHandlerBase | |
{ | |
public IntuitAuthenticationHandler(HttpClient httpClient, ILogger logger) | |
: base(httpClient, logger) | |
{ } | |
} | |
public sealed class IntuitAuthenticationMiddleware : OpenIDAuthenticationMiddlewareBase | |
{ | |
public IntuitAuthenticationMiddleware(OwinMiddleware next, IAppBuilder app, IntuitAuthenticationOptions options) | |
: base(next, app, options) | |
{ } | |
protected override AuthenticationHandler CreateSpecificHandler() | |
{ | |
return new IntuitAuthenticationHandler(_httpClient, _logger); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment