Last active
May 20, 2020 15:48
-
-
Save fquintanilla/d20aa178ba98256347cb7ce18c48d40f to your computer and use it in GitHub Desktop.
BearerTokenAuthentication (https://offering.solutions/blog/articles/2015/10/03/token-authentication-with-claims-and-asp-net-webapi/)
This file contains hidden or 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 partial class Startup | |
| { | |
| // For more information on configuring authentication, please visit http://go.microsoft.com/fwlink/?LinkId=301864 | |
| public void Configuration(IAppBuilder app) | |
| { | |
| var OAuthOptions = new OAuthAuthorizationServerOptions | |
| { | |
| TokenEndpointPath = new PathString("/Token"), | |
| Provider = new ApplicationOAuthProvider(), | |
| AccessTokenExpireTimeSpan = TimeSpan.FromDays(14), | |
| AllowInsecureHttp = ConfigurationHelper.Instance.GetAppSetting("TokenAllowInsecureHttp", false) | |
| }; | |
| // Enable the application to use bearer tokens to authenticate users | |
| app.UseOAuthBearerTokens(OAuthOptions); | |
| } | |
| } |
This file contains hidden or 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
| <add key="owin:AutomaticAppStartup" value="true" /> |
Author
fquintanilla
commented
Dec 12, 2018


Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment