ASP.NET Core 2.2 - JWT Authentication API
For documentation and instructions check out http://jasonwatmore.com/post/2018/08/14/aspnet-core-21-jwt-authentication-tutorial-with-example-api
ASP.NET Core 2.2 JWT Authentication API
Home Page: http://jasonwatmore.com/post/2018/08/14/aspnet-core-21-jwt-authentication-tutorial-with-example-api
License: MIT License
ASP.NET Core 2.2 - JWT Authentication API
For documentation and instructions check out http://jasonwatmore.com/post/2018/08/14/aspnet-core-21-jwt-authentication-tutorial-with-example-api
Obv I no that I use the Authorise and that should redirect me to your Authenticate method but will that be checked each time or do i need to implement IUserService Before I issue the json ?
hi,the demo can run successful.But when i change appsettings.json file about AppSettings.And i change the Secret string "THIS IS USED TO SIGN AND VERIFY JWT TOKENS, REPLACE IT WITH YOUR OWN SECRET, IT CAN BE ANY STRING" into any word. Then i call the api Authenticate,It is brokes down in method "tokenHandler.CreateToken(tokenDescriptor)",and the wrong info is IDX10603: Decryption failed. Keys tried: '[PII is hidden]'.
Exceptions caught:
'[PII is hidden]'.
token: '[PII is hidden]'
Parameter name: KeySize
Can you please tell me,how to get over this issue.Thanks
I have try same code but facing Unauthorized error.
I have using swagger. i have attach snap and also code. so can you find out problem.
what is the issue.
aspnet-core-jwt-authentication-api-master.zip
Hi,
When I run your sample I got a HTTP ERROR 404
The browser open at : http://localhost:58267/
I have also try with postman and everything looks empty ! I have put breakpoint but they don't stop !
Do you have a C# sample for the client too ? It will be helpful :-)
I tried to test the app running
$ curl -d "username=test&password=test" -X POST http://localhost:4000/users/authenticate
{"type":"https://tools.ietf.org/html/rfc7231#section-6.5.13","title":"Unsupported Media Type","status":415,"traceId":"0HLMEPV7RSATF:00000001"}
Same error if I try with vscode rest client like this:
POST http://localhost:4000/users/authenticate
accept: application/json
content-type: application/x-www-form-urlencoded
username=test
&password=test
I get:
HTTP/1.1 415 Unsupported Media Type
Connection: close
Date: Thu, 02 May 2019 07:36:26 GMT
Content-Type: application/problem+json; charset=utf-8
Server: Kestrel
Transfer-Encoding: chunked
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.13",
"title": "Unsupported Media Type",
"status": 415,
"traceId": "0HLMEPV7RSATG:00000001"
}
I think it would be very useful to add to the docs a curl command line to test the app
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.