owin

Shorten access token returned by OWIN in ASP.NET WebAPI 2

怎甘沉沦 提交于 2021-02-07 09:28:29
问题 We've developed a REST API using ASP.NET WebAPI 2 & secured it using ASP.NET Identity. The client required that their token be set to a long expiration time, as they store the access token in their database. During testing, they requested that we reduce the length of the token, as their database can only handle strings up to 250 characters. Our implementation is pretty "vanilla". Below are the options we're currently setting for the bearer token: OAuthOptions = new

Error loading System.IdentityModel.Tokens.Jwt dll in WebAPI2 project

别说谁变了你拦得住时间么 提交于 2021-02-06 10:01:47
问题 I am getting the below error in WebApi2 project: Could not load file or assembly 'System.IdentityModel.Tokens.Jwt, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) I have these set of related NuGet packages installed, along with a bunch of others: "Microsoft.IdentityModel.Protocol.Extensions" version="1.0.2.206221351"

Practical examples of OWIN middleware usage [closed]

*爱你&永不变心* 提交于 2021-02-06 08:56:37
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . Improve this question I consider my self a rank beginner to OWIN and after reading a lot of documentation I have only gotten more confused with conflicting notions than before I began. I know these are multiple questions, but I feel answering these will clear most fundamental

Practical examples of OWIN middleware usage [closed]

假如想象 提交于 2021-02-06 08:52:33
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . Improve this question I consider my self a rank beginner to OWIN and after reading a lot of documentation I have only gotten more confused with conflicting notions than before I began. I know these are multiple questions, but I feel answering these will clear most fundamental

Practical examples of OWIN middleware usage [closed]

…衆ロ難τιáo~ 提交于 2021-02-06 08:52:13
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . Improve this question I consider my self a rank beginner to OWIN and after reading a lot of documentation I have only gotten more confused with conflicting notions than before I began. I know these are multiple questions, but I feel answering these will clear most fundamental

API end point returning “Authorization has been denied for this request.” when sending bearer token

让人想犯罪 __ 提交于 2021-02-05 23:17:13
问题 I've followed a tutorial to protect a Web API with OAuth in C#. I'm doing some tests and so far I've been able to get the access token successfully from /token . I'm using a Chrome extension called "Advanced REST Client" to test it. {"access_token":"...","token_type":"bearer","expires_in":86399} This is what I get back from /token . Everything looks good. My next request is to my test API Controller: namespace API.Controllers { [Authorize] [RoutePrefix("api/Social")] public class

API end point returning “Authorization has been denied for this request.” when sending bearer token

妖精的绣舞 提交于 2021-02-05 22:51:26
问题 I've followed a tutorial to protect a Web API with OAuth in C#. I'm doing some tests and so far I've been able to get the access token successfully from /token . I'm using a Chrome extension called "Advanced REST Client" to test it. {"access_token":"...","token_type":"bearer","expires_in":86399} This is what I get back from /token . Everything looks good. My next request is to my test API Controller: namespace API.Controllers { [Authorize] [RoutePrefix("api/Social")] public class

No owin.Environment with Put requests

半世苍凉 提交于 2021-01-29 06:26:50
问题 In my current project I'm using AspNet.Mvc 5.2.7 and Owin 4.1.0 My issue is that whenever I try to access to the Owin Context from a put request (i.e.: HttpContextBase.GetOwinContext() ) I get the error message: No owin.Environment item was found in the context. All's good with [HttpPost] and [HttpGet] but not with Put so looks like Identity has been introduced properly. As soon as I changed the very same request to post it started working as well. Went through a lot of SO posts but didn't

Owin selfhost: using netsh to add an urlAcl seems to cause 503

本小妞迷上赌 提交于 2021-01-29 03:08:09
问题 I have a owin selfhost of a simple WebApi running as a windows service. After creating/installing certificates to aproach this WebApi through https, I got the certificate working but stayed stuck with a return code of 503. It seemed not a certificate problem, the browser does not complain anymore and shows a closed lock as intended. I changed the service account during the certificate installation, so to test if that was the problem I changed the listening address back to http. It worked fine

How do I make the AuthorizeEndpointPath work in ASP.NET Oauth 2.0 framework

∥☆過路亽.° 提交于 2021-01-27 06:45:14
问题 I currently have a website where I am trying to implement the OAuth server framework. The website is currently a combination of Web Forms (not MVC) and Web API 2. For the purposes of what I am trying to do, we cannot change the overall architecture of the system. So far, I have OAuth working via the Web API for validating clients, generating access tokens, and handling refresh tokens. The last piece I am trying to implement is the Authorize Code workflow. This will allow us to grant access to