Last active
April 30, 2016 22:41
-
-
Save brentschmaltz/7581eeabcec4d65d8a41 to your computer and use it in GitHub Desktop.
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
// startup.auth.cs | |
{ …. | |
var openIdConnectAuthenticationOptions = | |
new OpenIdConnectAuthenticationOptions | |
{ | |
Authentication Type = OpenIdConnectAuthenticationDefaults.AuthenticationType, | |
Authority = authority, | |
ClientId = client ID, | |
Notifications = | |
new OpenIdConnectAuthenticationNotifications | |
{ | |
AuthorizationCodeReceived = AuthorizationCodeReceived, | |
AuthenticationFailed = AuthenticationFailed, | |
MessageReceived = MessageReceived, | |
// 'parameter=value', will be added to the query string. | |
RedirectToIdentityProvider = (notification) => | |
{ | |
notification.ProtocolMessage.Parameters["parameter"] = "value"; | |
return Task.FromResult(0); | |
}, | |
SecurityTokenReceived = SecurityTokenReceived, | |
SecurityTokenValidated = SecurityTokenValidated, | |
}, | |
}; | |
app.UseOpenIdConnectAuthentication(openIdConnectAuthenticationOptions); | |
….} | |
public static Task AuthorizationCodeReceived(AuthorizationCodeReceivedNotification notification) | |
{ | |
return Task.FromResult<object>(null); | |
} | |
public static Task Authentication Failed(AuthenticationFailedNotification<OpenIdConnectMessage, OpenIdConnectAuthenticationOptions> notification) | |
{ | |
return Task.FromResult<object>(null); | |
} | |
public static Task MessageReceived(MessageReceivedNotification<OpenIdConnectMessage, OpenIdConnectAuthenticationOptions> notification) | |
{ | |
return Task.FromResult<object>(null); | |
} | |
public static Task SecurityTokenReceived(SecurityTokenReceivedNotification<OpenIdConnectMessage, OpenIdConnectAuthenticationOptions> notification) | |
{ | |
return Task.FromResult<object>(null); | |
} | |
public static Task SecurityTokenValidated(SecurityTokenValidatedNotification<OpenIdConnectMessage, OpenIdConnectAuthenticationOptions> notification) | |
{ | |
return Task.FromResult<object>(null); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment