bearer-token

JWT Bearer Token Flow

与世无争的帅哥 提交于 2020-01-01 05:23:09
问题 What I want is a method of JWT Generation and JWT Consumption in ASP.NET Core. No OAuth2 flow, I do have the IdentityServerv3 working with OAuth2 but it is just overkill for a single app accessing an API when I own both sides. The main source of difficulty I am having is finding out the equivalent of Microsoft.Owin.Security.Jwt in ASP.NET Core. Nothing in this list https://www.myget.org/gallery/aspnetvnext seems to relate. Or is that package actually to stay relevant in with ASP.NET Core? 回答1

What does bearer stand for?

微笑、不失礼 提交于 2019-12-31 03:39:06
问题 In context of jwt tokens the word bearer ist used. I cannot find a lot about bearer on Google. I was wondering where the terms comes from and what it stand for? And why is it prefixed? 回答1: why is it prefixed? Because otherwise it would just be a bunch of random characters with no context whatsoever, other than knowing that it's some info for some type of authorization. what it stand for? That the one who bears the token has the authority to do whatever the token allows where the terms comes

Yii2 Rest API Bearer Authentication

只谈情不闲聊 提交于 2019-12-30 06:13:09
问题 I've made a Yii2 REST API. With the API you can get a list of cars. Now I want to use the Bearer Authentication to protect the API. But I don't know how it works. First of all. I set up the authenticator in the behaviors method of my controller. public function behaviors(){ return [ 'contentNegotiator' => [ 'class' => ContentNegotiator::className(), 'formats' => [ 'application/json' => Response::FORMAT_JSON, ], ], 'authenticator' => [ 'class' => CompositeAuth::className(), 'authMethods' => [

Manually decode OAuth bearer token in c#

你离开我真会死。 提交于 2019-12-30 04:22:06
问题 In my Web Api 2.2 OWIN based application I have a situation where I manually need to decode the bearer token but I don't know how to do this. This is my startup.cs public class Startup { public static OAuthAuthorizationServerOptions OAuthServerOptions { get; private set; } public static UnityContainer IoC; public void Configuration(IAppBuilder app) { //Set Auth configuration ConfigureOAuth(app); ....and other stuff } public void ConfigureOAuth(IAppBuilder app) { OAuthServerOptions = new

Azure hosted api bearer tokens wont decrypt with context.DeserializeTicket?

徘徊边缘 提交于 2019-12-24 17:30:01
问题 I have 2 webapi2 projects that use the same database. If I'm on localhost I get a bearer token from one I can pass it to the other and the other will properly decrypt it and load the user. However when I publish them to separate urls on azure, I get the one token fine from one but when I pass it to the other I can't get the ticket to load and it gives me the unauthorized response. I'm testing this by watching the owin AuthenticationTokenProvider.OnRecieve method. When context

Azure hosted api bearer tokens wont decrypt with context.DeserializeTicket?

我怕爱的太早我们不能终老 提交于 2019-12-24 17:29:09
问题 I have 2 webapi2 projects that use the same database. If I'm on localhost I get a bearer token from one I can pass it to the other and the other will properly decrypt it and load the user. However when I publish them to separate urls on azure, I get the one token fine from one but when I pass it to the other I can't get the ticket to load and it gives me the unauthorized response. I'm testing this by watching the owin AuthenticationTokenProvider.OnRecieve method. When context

Create Draft mail in Office 365 via Web API

与世无争的帅哥 提交于 2019-12-24 13:26:17
问题 I have a Web API backend with EF and use AzureAD to authenticate my (office365)users of the web application that is written in AngularJS. Now I want to create a draft mail in my Web API but I don't know where to start. Can I just call the Office 365 mail API in my Web API? POST https://outlook.office365.com/api/{version}/me/sendmail But how do I pass the authentication token with it? Here is the Auth config that I use now and it works for other data requests. public static class Auth {

Oauth2 Header - “Authorization: Bearer (token)” doesn't work

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-24 01:37:19
问题 I am using Lumen as backend. I successfully authenticated user and got the token, but when I am trying to get protected data, it doesn't let me with Authorization: Bearer TOKEN . I tried with both Postman & Swift. ( I also tried Authorization: BearerTOKEN ) I tried making a call from ios app and adding header: Authorization: Bearer y57WWNRNKNpJkXugT6v1YG7Et13PBgT5xNkAB1bg however it doesn't let me pass the validation. Specifically: let headers = ["Authorization": "Bearer \(token)"] Then I

Owin authentication between MVC 5 and Web API (separate IIS applications)

走远了吗. 提交于 2019-12-23 04:56:26
问题 I have a working app with MVC5 and Web API (both different IIS applications) using Forms Authentication and Bearer token. Yes, they must remain two separate IIS applications. I am using the auth token as the username in my Forms Authentication cookie and that's how I am able to pass the token back and forth from MVC and Web API. I am also using Asp.net Identity 2.0. I would like to take Forms Authentication out of the equation and just use Owin Authentication but the User.Identity

Owin authentication between MVC 5 and Web API (separate IIS applications)

我怕爱的太早我们不能终老 提交于 2019-12-23 04:55:46
问题 I have a working app with MVC5 and Web API (both different IIS applications) using Forms Authentication and Bearer token. Yes, they must remain two separate IIS applications. I am using the auth token as the username in my Forms Authentication cookie and that's how I am able to pass the token back and forth from MVC and Web API. I am also using Asp.net Identity 2.0. I would like to take Forms Authentication out of the equation and just use Owin Authentication but the User.Identity