Multiple JWTs in .NET: How to Implement Multi-Token Authentication

  Рет қаралды 7,555

Milan Jovanović

Milan Jovanović

Күн бұрын

Пікірлер: 39
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
Want to master Clean Architecture? Go here: bit.ly/3PupkOJ Want to unlock Modular Monoliths? Go here: bit.ly/3SXlzSt Join a community of 1000+ .NET developers: www.patreon.com/milanjovanovic
@dotnetMasterCSharp
@dotnetMasterCSharp Ай бұрын
This is absolutely useful , thank you Milan!
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
@@dotnetMasterCSharp Glad you enjoyed it. This has been asked many times in the channel, so figured I'd cover it.
@thiagomatu
@thiagomatu Ай бұрын
Nice, I work on an application that supports multiple authentication providers, but this your code is so much clean and easier to understand, thanks for sharing this Milan!
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
Glad it helped!
@ruekkart
@ruekkart Ай бұрын
Awesome! I was thinking about this for a multitenant app where each tenant can define its own auth provider, and this seems pretty helpful for that.
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
That's a great idea!
@AbdulHaseeb-vc5yv
@AbdulHaseeb-vc5yv Ай бұрын
Exactly what I needed. Thanks!
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
Awesome
@johncerpa3782
@johncerpa3782 Ай бұрын
Great video!
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
Thanks!
@kabal911
@kabal911 Ай бұрын
Nice. I coincidentally did a pretty similar thing yesterday, where I wanted to support Cookie auth OR JWT auth. Took a bit of time to figure out the existence of AuthorizationBuiler and the DefaultPolicy
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
Nice work!
@timur2887
@timur2887 Ай бұрын
Thank you!
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
You're welcome!
@cesarmauricioguerrerobatre591
@cesarmauricioguerrerobatre591 Ай бұрын
Amazing, it was a masterful explanation, what happens when I have several clients coming from keycloak and I need a certain client to access a certain number of enpoints, how do I do this?
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
Check out Keycloak authorization
@yaelsleman660
@yaelsleman660 Ай бұрын
Mr please.. I need to know what is you opinion about ABP framework and it is important to learn it?
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
Can't say
@nenzax2701
@nenzax2701 Ай бұрын
Great Video, quick question, how do we tie a particular controller method to a specific jwttoken, ex: api/getusers should use keycloak, api/getadmins should use supabse
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
Authorize[AuthenticationSchemes: "custom_scheme_name"] I may have missed the exact syntax, but you can specify the scheme you want to use for a given controller/endpoint
@vichustephen4475
@vichustephen4475 26 күн бұрын
@@MilanJovanovicTech But if I put both schemes , the middleware will make public cert verification requests to both endpoints . Need to use AddPolicyScheme with forward selector
@michxkowal4282
@michxkowal4282 Ай бұрын
Hi, do you know how to change the secret key while the API is running? I would like to be able to externally change secret in certain situations.
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
Update the ENV var
@thomasvlima
@thomasvlima Ай бұрын
And a multitenant API where each tenant has its own user pool?
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
But same auth provider?
@thomasvlima
@thomasvlima Ай бұрын
@MilanJovanovicTech yes. For example, using cognito, each tenant has its own user pool. And each user pool can have its own AD integration
@eduardoyupanqui
@eduardoyupanqui Ай бұрын
Wow, its no necessary add policyscheme to select the scheme to validate?
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
But you can if you want to
@binoypatel09
@binoypatel09 Ай бұрын
Is Microsoft Entra ID work same way?
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
In what way do you mean?
@binoypatel09
@binoypatel09 Ай бұрын
Let say I have a server app with the multiple different client apps, some apps use built-in authentication in the server app and some uses Microsoft Entra ID withe the same server app, so how am I going to accomplish this?
@mr-black_rock321
@mr-black_rock321 6 күн бұрын
How to secure jwt access token in SPA (Single Page Application)
@MilanJovanovicTech
@MilanJovanovicTech 6 күн бұрын
Same-site + Secure cookie
@mr-black_rock321
@mr-black_rock321 5 күн бұрын
@@MilanJovanovicTech BFF can secure the access token ?
@codenetw
@codenetw Ай бұрын
Thx!
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
Any time
Which API Gateway is better? YARP vs Ocelot
24:01
Milan Jovanović
Рет қаралды 7 М.
Session Vs JWT: The Differences You May Not Know!
7:00
ByteByteGo
Рет қаралды 300 М.
Try this prank with your friends 😂 @karina-kola
00:18
Andrey Grechka
Рет қаралды 9 МЛН
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 30 МЛН
How To Handle Permissions Like A Senior Dev
36:39
Web Dev Simplified
Рет қаралды 302 М.
Deploy .NET Aspire Apps to Azure in Minutes | Simple Deployment Tutorial
17:32
AWK - A Tool That Does Too Much
11:10
The Exhausted Programmer
Рет қаралды 18 М.
Solution2: Plugin Architecture in C# with Nick Cosentino
52:53
.NET Foundation
Рет қаралды 5 М.
Implementing JWT Authentication in ASP.NET Core
23:51
Nick Chapsas
Рет қаралды 46 М.
DTOs & Mapping : The Good, The Bad, And The Excessive
11:03
CodeOpinion
Рет қаралды 18 М.
What's new in .NET 9 and C# 13
19:21
Filip Ekberg
Рет қаралды 20 М.
Refresh Token Rotation With Next-Auth V5 || Managing Tokens With A Custom Backend
48:28
tapaScript by Tapas Adhikary
Рет қаралды 10 М.
Try this prank with your friends 😂 @karina-kola
00:18
Andrey Grechka
Рет қаралды 9 МЛН