🚀 Join the .NET Web Academy with a 30% discount - closing soon! 👉 www.dotnetwebacademy.com/courses/academy?coupon=dnwas23yt
@joaogabrielv.m328 Жыл бұрын
Great video, Patrick! Any chances to have a video teaching the basics of Identity Framework with MVC?
@UserUser5-c4c Жыл бұрын
Your videos are 5-stars :) Just a hint about issue with invalid SignInKey while using user-jwts generated token (20:36 in video), in the application instead of decoding key into UTF8 it is required to docode it as base64 and it will work.
@jzn007x Жыл бұрын
Could you give us the example?
@UserUser5-c4c Жыл бұрын
@@jzn007x here is raw example: in Patrick's example in program.cs file, under AddAuthentication modify part where he is declaring IssuerSignInKey with => new SymmetricSecurityKey(Convert.FromBase64String("HereYouShouldPasteSigningKeyGeneratedByUseJwts"))
@ynkdqe Жыл бұрын
Your tutorials are very helpful and easy to understand
@PatrickGod Жыл бұрын
Glad you think so! Thanks so much!
@akbaralimajeed Жыл бұрын
Hi, if anyone gets the error while create jwt token as "dotnet : No project found at `-p|--project` path or current directory.", make sure you run above command inside the project folder not on the root folder (solution level), it requires to be in the same project file folder; hope this helps ):
@nguyenthanhat6122 Жыл бұрын
thank you so much
@Avster9 Жыл бұрын
Great video! Can you make a video with simple CQRS implementation?
@ivandrofly Жыл бұрын
Nice... I didn't know u could gen keg with dotnet command
@elishamisoi8 ай бұрын
Thank you so much Patrick.
@rezach7536 Жыл бұрын
Make more videos about authentication please. Thanks
@abdulhakimawad Жыл бұрын
Id do every thing like you, but the lock in the weather methode stills opened & return unauthorized error, why??
@SportProgramming Жыл бұрын
I cannot get it to accept the token, no matter what i do in jwt if i enable the secret code.
@ViktorTy Жыл бұрын
I just watched and implemented the .NET 6 Web API Authorization and now I see there is a new one haha what are the chances
@BlackGrinch-dl9qz Жыл бұрын
Awesome buddy!
@augustusdevree5434 Жыл бұрын
Is the signiture key was not found [@20:32] not the result of confronting the the token generated by the CLI with it's signing key "6ffvSugNwB6..." [@20:12] and your signing key specified in AppSettings:Token key "my top secret key" [@19:35]?
@Klayperson Жыл бұрын
that's what i was thinking. for a second he did paste in the configuration path to the key from the CLI, but he didn't save it that way
@ArmedMob Жыл бұрын
@@Klayperson Threw me for a loop in my app as I did not see him not save that. I did find as long as both are the same it works.
@thegamer1599 Жыл бұрын
can someone tell me what patrick did at 11:04 coz im not using swagger from start, are there any other possible ways to do that?
@dindjarin332 Жыл бұрын
Hi teacher can you cover OpenIddict library in detail?
@thomasdevelopment Жыл бұрын
Once a user is logged in how is the token being stored to maintain the user state?
@jamisonr Жыл бұрын
The front end developer must handle it. One such way using Angular is to take the key from the login response and store it in the browser's application settings, then using an HttpInterceptor, all requests have the correct authentication header added with the stored jwt as the value. No doubt all popular web frameworks have similar mechanisms.
@ndrcreates_per Жыл бұрын
I've done all of the auth completly in my app. my problem is i want to make my client app to send authorization into the server api, so i wont ,manually copy and past token bearer in swagger. how can i fix this? what is the name of this topic? i'm new in the field. thanks.
@ndrcreates_per Жыл бұрын
i have done httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", loginResponse.Token); but it wont work. please create a tutorial on this topic, its the final result of an auth and its a waste that it's not finalized.
@jesusnaun1981 Жыл бұрын
Someone help me please. when I execute dotnet user-jwts create in console, this show me that error: dotnet : No project found at `-p|--project` path or current directory. At line:1 char:1 + dotnet user-jwts create + ~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (No project foun...rent directory.:String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError
@akbaralimajeed Жыл бұрын
Hi, make sure you run above command inside the project folder not on the root folder (solution level), it requires to be in the same project file folder; hope this helps ):
@SANGCAOHOAI Жыл бұрын
"cd" to the folder which have Container foler there
@tanishbansal5767 Жыл бұрын
I get an error while using the dotnet user-jwts create and the error I get is : dotnet : No project found at `-p|--project` path or current directory. At line:1 char:1 + dotnet user-jwts create + ~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (No project foun...rent directory.:String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError Can you please tell me the solution for this ?
@PunisherSamo Жыл бұрын
It might be that you are not with Package Manager Console in right folder ? Try to navigate into folder where you have another folders of youre API -> like bin, Controllers, Migrations, Models, Properties and so on. Navigate there through Package Manager Console (cd "path") and check content of folder by typing command dir to be sure that you are really there. It might be because you are also trying command on already running API. Another special cases of this error I found on stack overflow go ahead and check it as well.
@akbaralimajeed Жыл бұрын
Hi, make sure you run above command inside the project folder not on the root folder (solution level), it requires to be in the same project file folder; hope this helps ):
@SANGCAOHOAI Жыл бұрын
@@PunisherSamoIt's so wonderful for me, witt lots of thanks, hope you earn lots of money tomorow
@esdegan7176 Жыл бұрын
how about refresh token?
@hosannaliving Жыл бұрын
Yes please
@leftjabrighthook7 ай бұрын
Amen. There are 2993753 tutorials on .net jwt. Not one about refresh that isn’t total jank.
@godizord Жыл бұрын
Hey, great video, sadly my generated token still generates 401 error, any ideas?
@LovePeaceBeer Жыл бұрын
How do you expect people to give you ideas without looking at your code? We can't use our Jedi powers unfortunately.
@sutinpoonking4104 Жыл бұрын
try add audience , fix issue for me. Example: - in method CreateToken : var token = new JwtSecurityToken( issuer: _config["JWT:ValidAudience"], audience: _config["JWT:ValidAudience"], claims: claims, expires: DateTime.Now.AddDays(1), signingCredentials: creds ); - in Program.cs: builder.Services.AddAuthentication().AddJwtBearer(options => { options.TokenValidationParameters = new TokenValidationParameters { ValidateIssuerSigningKey = true, ValidateAudience = true, ValidateIssuer = true, ValidAudience = builder.Configuration["JWT:ValidIssuer"], ValidIssuer = builder.Configuration["JWT:ValidIssuer"], IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(builder.Configuration.GetSection("Appsettings:Token").Value!)), }; });
@nickgendron9187 Жыл бұрын
@@sutinpoonking4104 fixed for me, thanks!
@vishalsinghal6719 Жыл бұрын
how to create token based on new login?
@vishalsinghal6719 Жыл бұрын
trying to ask, how i can create token that u made using CLI