bearer-token

Missing extension method AddJwtBearerAuthentication() for IServiceCollection in .NET Core 2.0

混江龙づ霸主 提交于 2019-12-10 13:17:22
问题 I have updated my project from Core 1.1 to Core 2.0 using instructions from https://blogs.msdn.microsoft.com/webdev/2017/08/14/announcing-asp-net-core-2-0/ (updated target framework to .NET Core 2.0 and used metapackage Microsoft.AspNetCore.All). I have updated all possible nuget packages to latest versions as well. In .NET Core 1.1 i was adding JWT Bearer Authentication this way: app.UseJwtBearerAuthentication(); // from Startup.Configure() As per http://www.talkingdotnet.com/whats-new-in

Authorization header not making it through in Codeception API testing

会有一股神秘感。 提交于 2019-12-10 02:54:34
问题 I am attempting to test my Laravel 4 REST API using Codeception, but when I try to send through my Authorization header (using the $I->amBearerAuthenticated() function of the REST module) it is not making it through to the eventual request. From what I can see, the Symfony2 BrowserKit module modifies any headers added into the HTTP_XXX_XXX format, so the header being sent seems to be HTTP_AUTHORIZATION - when I output the received headers in my application, however, neither Authorization nor

Where should I inject Bearer tokens into $http in AngularJS?

Deadly 提交于 2019-12-08 17:20:56
问题 After the user's credential has been accepted I fetch the Bearer token [1] and update the default headers: $http.defaults.headers.common.Authorization = "Bearer #{data.access_token}" This is done at the end of the $scope.signIn() method. Will the tokens be persistent throughout the entire session or should I use an other technic? [1] https://github.com/doorkeeper-gem/doorkeeper/wiki/Client-Credentials-flow app.run run = ($http, session) -> token = session.get('token') $http.defaults.headers

Custom Error message using passport Bearer

陌路散爱 提交于 2019-12-08 16:41:42
问题 I'm using passport to secure my API. I kind of struggle to understand how i'm supposed to send back custom message in case of error and i'm hoping to find an answer here. Here is what i did: A route (server.js): router.route('/Applications').get(authController.BearerAuthenticated, applicationController.getApplications); My Passport Stuff (authController.js): Passport.use(new BearerStrategy(function(token, cb) { Token.findOne({token: token}, function(err, token){ if (err){return cb(null, false

BotBuilder, Direct Line API returns “tokenParameters is missing User” with Enhanced authentication options

蓝咒 提交于 2019-12-07 19:47:39
问题 I have a bot published on an Azure account, from which I'm trying to take the magic code out, so following the Direct Line documentation I improved the code to hide the token. But once the Enhanced authentication options are enabled I always get the same response. { "error": { "code": "BadArgument", "message": "tokenParameters is missing User." } } And I am not able to figure out how to complete the HTTP Request with the user data. The bot is based on BotFramework SDK v4, plus some

Custom Bearer Token Authorization for ASP.Net Core

冷暖自知 提交于 2019-12-07 15:03:53
问题 Is this an acceptable implementation of a custom bearer token authorization mechanism? Authorization Attribute public class AuthorizeAttribute : TypeFilterAttribute { public AuthorizeAttribute(): base(typeof(AuthorizeActionFilter)){} } public class AuthorizeActionFilter : IAsyncActionFilter { private readonly IValidateBearerToken _authToken; public AuthorizeActionFilter(IValidateBearerToken authToken) { _authToken = authToken; } public async Task OnActionExecutionAsync(ActionExecutingContext

401 when authenticating an OAuth 2.0 bearer token with Microsoft Azure Active Directory in an MVC API

a 夏天 提交于 2019-12-07 01:46:48
问题 I'm writing an API service in MVC (no views, just API), and I want to use OAuth 2.0 tokens acquired via the client_credentials flow (2-legged OAuth). I created an ActiveDirectory app in the Azure management portal , and have successfully acquired a bearer token (see screenshot from Postman at the bottom). Then I installed the Microsoft.Owin.Security.ActiveDirectory nuget package, created an Owin startup class and wrote the following code in it: public class OwinStartup { public void

Yii2 REST api bearer authentication

纵饮孤独 提交于 2019-12-06 13:11:50
问题 I am using Yii2 framework as the backend and react js for the client side. I am trying to create REST api with HTTPBearer authentication but always get a 401 Unauthorized error . I have followed the Yii2 Rest api authentication with no success. I have also implemented findIdentityByAccessToken on user.php and access_token on my sql. My files:- Folder structure:- -api --config --main.php --main-local.php ... --modules --v1 --controllers --CheckinsController.php -backend -common -frontend ..

BotBuilder, Direct Line API returns “tokenParameters is missing User” with Enhanced authentication options

三世轮回 提交于 2019-12-06 12:53:20
I have a bot published on an Azure account, from which I'm trying to take the magic code out, so following the Direct Line documentation I improved the code to hide the token. But once the Enhanced authentication options are enabled I always get the same response. { "error": { "code": "BadArgument", "message": "tokenParameters is missing User." } } And I am not able to figure out how to complete the HTTP Request with the user data. The bot is based on BotFramework SDK v4, plus some controllers for requesting and refreshing the token using the encapsulted secret key. I added userId data to the

Owin middleware for Bearer Token Authentication that supports JWT key rotation

泄露秘密 提交于 2019-12-06 08:22:01
问题 I am looking for some guidance with configuring owin middleware bearer token authentication to support Open Id Connect key rotation. The Opend Id Connect spec says the following about key rotation: Rotation of signing keys can be accomplished with the following approach. The signer publishes its keys in a JWK Set at its jwks_uri location and includes the kid of the signing key in the JOSE Header of each message to indicate to the verifier which key is to be used to validate the signature.