Тёмный

ASP.NET Core Custom OAuth Server (.NET 7 Minimal Apis C#) 

Raw Coding
Подписаться 73 тыс.
Просмотров 31 тыс.
50% 1

Опубликовано:

 

6 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 54   
@shanselman
@shanselman Год назад
Fantastic job! ❤🎉
@RawCoding
@RawCoding Год назад
Thank you Scott, means a lot )
@allinvanguard
@allinvanguard Год назад
Well done, appreciate all the Identity videos, granted the officials doc lacks a lot
@yonibauduin
@yonibauduin Год назад
Very nice video and good explanations! Quick question: in the token endpoint at 18:03, you set the sub claim to a NewGuid(). What would be the correct implementation if we want to keep track of the user? Should it be added to a new property in the AuthCode class and set during the Authorization endpoint? And then if we want to add other claims, a database lookup should occur in the token endpoint, am I right? Thanks for clarifying this! Keep the good work :) I hope you'll make an OpenId Connect video soon!
@vadymwork3983
@vadymwork3983 Год назад
Мое почтение, сударь) Сказку прослушал внимательно)
@JohnOliverAtHome
@JohnOliverAtHome Год назад
Anton, for parsing a query string (will work for any string that looks like a query string), you can use the the System.Web.HttpUtility.ParseQueryString() method.
@RawCoding
@RawCoding Год назад
Looks perfect 👍 thanks for sharing
@fieryscorpion
@fieryscorpion 11 месяцев назад
That was awesome. Question: How do you handle `Challenge` in this case? Like how do you provide login form for the users to sign in if they navigate to [Authorize] pages? Also how do you provide Consent screen in this setup? Can you please elaborate on that? Maybe create a new video on that? Thank you!
@prathameshshende4
@prathameshshende4 Год назад
hey anton, you've already created another identity server, super amazing video I would love to see any small actual example using blazor wasm and webapi with oauth2.1 video !!
@ezmooj
@ezmooj Год назад
Thank you Anton great knowledge sharing
@RawCoding
@RawCoding Год назад
Thank you for watching friend!
@saurabhumadikar2345
@saurabhumadikar2345 8 месяцев назад
This was very helpful!❤
@maria_sss1254
@maria_sss1254 Год назад
I live in Latvia and here we have many free courses to help beginners start their IT career
@RawCoding
@RawCoding Год назад
Kur ir?
@maria_sss1254
@maria_sss1254 Год назад
​@@RawCoding I think, I forgot to enter the second part of the sentence😅. It was - "The mentors recommend us to learn from your asp.net videos"
@maria_sss1254
@maria_sss1254 Год назад
@@RawCoding you just asked "where is?" 😂If you ask about the country, Latvia is located somewhere in Europe. If you want to know the name of the courses, you are especially beloved by "she goes tech" students and mentors. The video where you make a chat is especially popular, because creating a chat is there a final test
@RawCoding
@RawCoding Год назад
I am from Latvia my self, and I was wondering about the free courses ) but I forgot most of the Latvia language by now.
@maria_sss1254
@maria_sss1254 Год назад
@@RawCoding WOW! Incredible! I feel like I just found my lost brother!😂😳 Maybe that's why Latvians love your tutorials so much - it is easy to understand you, because we think in a little similar way^^ Also I suppose that you are from a Russian speaking family, because only Russian speaking persons use this smile ")" instead of ":)". Am I right?) The most popular free courses in Latvia are made by Accenture. There are about 160 hours of learning and then the most motivated and talented students can get an internship in Accenture. So if you plan to make a new ASP.NET chat tutorial someday, say hi to Latvian Bootcamp students or to Latvian She Goes Tech students, if you wish to greet only girls😏
@RicardoJosue
@RicardoJosue 3 месяца назад
Increíble project , do you have a code example? Or how can get that? Greetings from México
@salman1277
@salman1277 Год назад
Great job!
@-matt_p-
@-matt_p- Год назад
Can I ask you if it is possible, once the web api has been authenticated, at the same time to protect certain actions of the webapi with authorization by checking the token received? Anyway, congratulations, a truly complete job
@kodastr5493
@kodastr5493 Год назад
Спасибо за доходчивое разъяснение материала. Еле смог подписаться на патрионе. Только никак не могу понять с конечной точкой /oauth/custom-cb. У меня ошибка при редиректе. В клиенте не нашел описания и в серверной части тоже
@RawCoding
@RawCoding Год назад
Какая ошибка?
@Dms07011
@Dms07011 Год назад
Bro, you'r rock! What about the client app logout? I'm trying to make a UI in the authorization server where the user can choose a bunch of client apps and then log in, kinda a sso. If the user log out from authorization server, the cookie in the client still work. I think i am messing up with the concepts pretty hard lol
@RawCoding
@RawCoding Год назад
Your question is really good! You want to have a session checking mechanism, ether a redirect or an http call.
@garciacgera
@garciacgera Год назад
What can I do if I want that the endpoint GET /login be a complete html file including styles, js and more? not just a plain html with two inputs. Thanks in advance!! And great video by the way.
@RawCoding
@RawCoding Год назад
Create the complete html.
@kostjaparanoid6842
@kostjaparanoid6842 Год назад
I go nuts. I don't understand how I can read login information in token endpoint so I can load the claims and pass them to client with token. Please help pipez
@abdullauthan
@abdullauthan Год назад
Great video. Thanks for your effort. I got one question. I want to check for client id and client secret for multiple clients. Where is the best place to validate? Is it login page post handler or Authorization handler? Where can I find the client secret inside authorization url? Thank you in advance
@RawCoding
@RawCoding Год назад
Store client is and secret in a database. And validate them at the authorisation and token endpoints. Read the rfc
@abdullauthan
@abdullauthan Год назад
@@RawCoding Thank you for your quick reply. In fact I could not find the client secret in the return url received at the authorization end point. I could see the client id. Is there any way to include the client secret with the return url? Thank you very much for your help
@RawCoding
@RawCoding Год назад
Can you open the specification and search for client secret and tell me where in the spec it says to put it in the authorisation endpoint.
@riccardoparolini7184
@riccardoparolini7184 3 месяца назад
Is there any possibility to find this project uploaded on GitHub in the near future?
@damientohin9643
@damientohin9643 6 месяцев назад
Wonderfull entry and intro, LMAO, but good tuto 😂😂
@rahimliparviz
@rahimliparviz Год назад
Hi Anton, could you say where did client pass parameters like for example "code_challange" or "code_challange_method" in the AuthorisationEndpoint class?
@RawCoding
@RawCoding Год назад
as pre specification pkce spec: www.rfc-editor.org/rfc/rfc7636#section-4.3 and oauth spec: www.rfc-editor.org/rfc/rfc6749#section-4.1.1 The client constructs the request URI by adding the following parameters to the query component of the authorization endpoint URI using the "application/x-www-form-urlencoded" format so you add these as query parameters to the get request.
@章邯-c5h
@章邯-c5h Год назад
3Q 受益匪浅 @Raw Coding
@RawCoding
@RawCoding Год назад
🫡 comrad
@freddycastelblancomacias6082
@freddycastelblancomacias6082 10 месяцев назад
Great tutorial !!!! i have one question btw, there is a way in which i can validate the client secret in the server side ?
@RawCoding
@RawCoding 10 месяцев назад
Check the database, store it like a password.
@freddycastelblancomacias6082
@freddycastelblancomacias6082 10 месяцев назад
@@RawCoding thanks for your answer, but I mean, is possible with this example make the machine-machine authorization/authentication ?
@RicardoJosue
@RicardoJosue 6 месяцев назад
Hi great video, can you share the project?
@uctran8127
@uctran8127 9 месяцев назад
Can you help me with this error? Although, I coded TokenEndpoint endpoint but got error " The input does not contain any JSON tokens. Expected the input to start with a valid JSON token, when isFinalBlock is true "
@LeonoX97
@LeonoX97 3 месяца назад
Hi, thank you for the video can you share the code please?
@ag4191
@ag4191 Год назад
What do I do if I protect web api?
@RawCoding
@RawCoding Год назад
what?
@ag4191
@ag4191 Год назад
@@RawCoding when I added attribute Authorize to my web api endpoint then returnUrl parameter doesn't contain code_challenge and code_challenge_method properties. I didn't add login endpoint to my web api so I didn't call Challenge method. Is it required in web api project?
@michabazejewicz6414
@michabazejewicz6414 Год назад
nice
@jpboy1962
@jpboy1962 Год назад
Watch this video. Learn about all the topics. Then go find a proper implementation, open source or commercial, and use that instead. Never use your own identity management solution for anything that matters. KeyCloak is an excellent option.
@RawCoding
@RawCoding Год назад
Always a safe bet
@matbmp
@matbmp Год назад
Does KeyCloak support oauth2.1?
@khanh9x6
@khanh9x6 Год назад
can you share your source code?
@JagathPS
@JagathPS 2 месяца назад
your deveky logic has an issue it should be like public class DevKeys { public DevKeys(IWebHostEnvironment env) { Rsakey = RSA.Create(); var path = Path.Combine(env.ContentRootPath, "crypto_key"); if(File.Exists(path)) { // Instead of creating a new rsaKey instance, use the existing Rsakey instance Rsakey.ImportRSAPrivateKey(File.ReadAllBytes(path), out _); } else { var privateKey = Rsakey.ExportRSAPrivateKey(); File.WriteAllBytes(path, privateKey); } } public RSA Rsakey { get; } public RsaSecurityKey RsaSecurityKey => new RsaSecurityKey(Rsakey); } Please let me know if I understood wrongly or if you had an issue.
Далее
Console App Authentication (.NET C#)
18:07
Просмотров 8 тыс.
OAuth 2.0 & 2.1 Explained
39:59
Просмотров 25 тыс.
Bro's Using 3 Weapons
00:36
Просмотров 3,5 млн
Forget Controllers and Minimal APIs in .NET!
14:07
Просмотров 70 тыс.
ASP.NET Core Authorization  (.NET 7 Minimal Apis C#)
21:31
OAuth 2.0 - a dead simple explanation
9:16
Просмотров 21 тыс.
What Authentication System Should I Use For My App?
20:41
Authentication Landscape (asp.net core examples)
45:36
Reviewing ASP.NET Core Authentication Setup
14:51
Просмотров 8 тыс.
An Illustrated Guide to OAuth and OpenID Connect
16:36
Просмотров 594 тыс.