Finally a comprehensive tutorial to understand how Web API token generation works. Very valuable for me!!
@tohabin50644 жыл бұрын
watching in 2020 for understanding the basics of token-based authentication. It helps me a lot. thank you love from Bangladesh
@luizfredericojr6 жыл бұрын
Sourav, why does not anyone show the client in CSharp, making the call to the Berear generator and the other calls? I can not use PostMan inside the ASP.NET MVC 5 system! Did you happen to have a link to an article that shows the client side (in c #) accessing the web api that generates and validates the berear token?
@sonypatil193 жыл бұрын
Searching stop here for token based authentication.😓😓 very Helpful video. Thanks a lot.
@sachinsachan3273 жыл бұрын
Thanks Sir, my question is where webapi stores the token in server side?
@sarojbala112 жыл бұрын
Its Really Helpful for creating Token Based Web API. Thanks for creating this content.
@augustous093 жыл бұрын
People saying jwt token is containing 3 parts. Seperated by . Dots. But in the tutorial token generated without dot. Can you explain about it.
@manaswiniswain37332 жыл бұрын
Hi, how we can get 403 forbidden error status in authenticating using oauth2?! It is a token based authentication where we pass client id, client secret and grant type as client credentials...after generation of access token to access to the protected resources one should get which status?! Can you clarify on this?!
@waqasjavaid92745 жыл бұрын
Very helpful tutorial. I want to ask one thing about this sample application that when we send 'token' to get data. how webApi came to know that this token is valid? means how and where it checks it?. Is server has a copy of that token or what?
@christiangajo94998 жыл бұрын
This video is what I'm looking for. Just a quick question, in 40:35 (grant_type) where did you set the value in the code (cs file) before calling the method
@rossmanson65248 жыл бұрын
Also wondering the same
@souravmondal458 жыл бұрын
+Christian Gajo where I have set username and password. Here I have sent username password and grant type.
@souravmondal458 жыл бұрын
+sourav mondal in the js file you can see this code I have used for login fac.login = function (user) { var obj = { 'username': user.username, 'password': user.password, 'grant_type': 'password' }; Object.toparams = function ObjectsToParams(obj) { var p = []; for (var key in obj) { p.push(key + '=' + encodeURIComponent(obj[key])); } return p.join('&'); }........ Here we have added grant_type
@bl8nc5 жыл бұрын
I needed to add the two lines at the bottom of the function to get it to return the token public override async Task GrantResourceOwnerCredentials(OAuthGrantResourceOwnerCredentialsContext context) { var identity = new ClaimsIdentity(context.Options.AuthenticationType); if (context.UserName == "admin" && context.Password == "123") { identity.AddClaim(new Claim(ClaimTypes.Role, "admin")); identity.AddClaim(new Claim("username", "admin")); identity.AddClaim(new Claim(ClaimTypes.Name, "Malcolm Swaine")); } else if (context.UserName == "test" && context.Password == "123") { identity.AddClaim(new Claim(ClaimTypes.Role, "test")); identity.AddClaim(new Claim("username", "test")); identity.AddClaim(new Claim(ClaimTypes.Name, "test user")); } else { context.SetError("invalid grant", "credentials are invalid"); } var ticket = new AuthenticationTicket(identity, null); context.Validated(ticket); }
@JNABrito7 жыл бұрын
When a password is passed like this 40:28 but in a regular form on a web page, is there anything preventing a sniffer from getting the password? If not, are there any known solutions for this problem (like encrypting the password in the form and decrypting later in the WebAPI when needed)?
@shyam135243 жыл бұрын
You are saying client sends user id and password to Authentication server, so what is mean by Authentication server? which Authentication server you are saying about?
@4324234fdsfds7 жыл бұрын
I really do no know . why dislikes :( . Its really nice article... It worked like charm... Thank you very much
@SaurabhKumar-nw5fy4 жыл бұрын
I want to authenticate using SAML request with an identity provider to be initiated from an .Net Framework Web API. Do you have any article or tutorial for this?
@bahmash77353 жыл бұрын
Very Helpful and I fully understood the process of Token Authentication
@lr-xe2mf3 жыл бұрын
How do send my token to my api consuming web application so it can authorize and have access to functions with [Authorize] above them?
@타코야끼-n6d7 жыл бұрын
Hello Sourav, Thank you for your video. I follow you video. but, I use not HandleUnauthorizedRequest Method in AuthorizeAttribute.cs, so I use OnAuthorization method and I have only return true for IsAuthenticated. I get 403. How can I to do
@ramkumar123443213 жыл бұрын
How to implement ADFS SAML Assertion Consumer with Redirct binding in .net core razor pages application? Please help
@pawankht8 жыл бұрын
Excellent Job. I am waiting for the PART 2 of this series
@souravmondal458 жыл бұрын
kzbin.info/www/bejne/n2Oxp4SohJxopNE
@kakmca5 жыл бұрын
I have generated access token for both "user" and "admin". For both of them, access_token is same. Can it happen like that?
@ProperComment7 жыл бұрын
Good work mate, thanks a ton, I tried this in Janauary but couldn't undertand, but today I have done this.
@ZahidHasan8 жыл бұрын
I would like to host this in IIS and access through JQuery AJAX... is that possible? I can't find the OWIN startup class.
@endatreanor52634 жыл бұрын
I can hit the controller even without the bearer token. What have I missed?
@AlongOurLife6 жыл бұрын
Is this kind of token base authentication secure against replay attack? I am assuming because the token is valid for a certain time the request can be replayed by attacker within that time frame as it does not have nonce.
@vemareddys6 жыл бұрын
this is not working in Asp.Net Core 2.0 WebAPI ,could you please suggest how can we achieve this using Asp.netCore 2.0
@combitz5 жыл бұрын
Token path does not bind correctly in current ASP.NET Web API 2 so no token can be generated
@anassaleem18278 жыл бұрын
how should i receive data with parameter in post form at server side?
@bijayalaxminayak70014 жыл бұрын
I am follow ur process (this video /article) also Token value not came In postman 404 not found error r come How to fix it ?????
@vennkatrddyyannam32173 жыл бұрын
Saurav,, post any wcf videos, plzz
@sumangeorge74 жыл бұрын
i am not getting where are you generating token. I suppose you must be using Azure AD.. but not passing any client secret key
@chenarrddelfin40423 жыл бұрын
can i use these api as 3rd party login api?
@rahoolmistry81372 жыл бұрын
Please share video for refresh token in OAuth 2.0 token implementation in c#, if you have any.
@kazmirci16 жыл бұрын
Sourav thanks for video.Can u add refresh token part ?
@UManIsC2daK7 жыл бұрын
Hey, great tute! thanks! How would the "logout" mechanism work? Or do we have to rely on token expiration?
@souravmondal457 жыл бұрын
In OAuth there is no option for signout. we can Delete the access token on the client. But 1 more option we have... that is if you want then you can save the token in a database table and check with that table data when a request come.
@mujtabakiani65923 жыл бұрын
When I try to generate token after all this process I am getting 404 error. localhost:44383/token. it returns 404
@Ashish-gg3pr7 жыл бұрын
{ "Message": "No HTTP resource was found that matches the request URI 'localhost:54473/token'.", "MessageDetail": "No type was found that matches the controller named 'token'." } getting this error while do post further things work properly can you solve this issue
@shivakumarshirke66254 жыл бұрын
When I tried to implement Google sign on in aap.net Web API and angular frontend framework am getting redirect uri mismatch as error can you please help me to resolve this issue
@Gurmeet2010mca7 жыл бұрын
Hello Sourav Mondal plz explain when we enter username and password,then token generate,where this token is stored, to validate the next request
@devkranthkishorevanja8907 жыл бұрын
HI Sourav..That was a great tutorial about Token based authentication. i tried out the way you have explained. but when i create the token and try to access the Authenication , the response i get is forbidden.So i removed the ! in "HttpContext.Current.User.Identity.IsAuthenticated" and i get the response as hello "dev". Is the the corrrect way of doing? and one more question i created a token for the admin user and tried to access the "Authenitcate" Method.Should it access or not? For me i was able to access? Correct me if am wrong?
@Spiritak6 жыл бұрын
Thank You, i was trying to make this for 2 days and thanks to your video it is finally working!
@sarjukabariya12238 жыл бұрын
It's great... thank you so much, Actually I am new for ASP.Net identity, and I want to know that in above demo where the users identity details like roles, claims etc are stored ? in memory, database or somewhere else ? And one more thing I want to refresh token after token get expired then what I have to do? Any reference for refreshing token.
@annupatel73166 жыл бұрын
hello can we give error code with error message in all cases , if we pass wrong token ten only one JSON response will with message parameter. but we need error code, if token is expire then we need an other response and error code. please update me sir
@parthintwala21623 жыл бұрын
Can I use this for .net core 3.1, Web API solution? Need urgent help.
@souravmondal453 жыл бұрын
yes you can use
@parthintwala21623 жыл бұрын
@@souravmondal45 Thank You, but after installing the nuget packages, I am getting the warning that those nuget packages may not be compatible with .net core 3.1. I hope that's fine, is it?
@TrivenSharma8 жыл бұрын
Many many thanks for creating this superb video... one suggestion here, it would be nice for a starter to get more details about the classes/references you have added in this project.
@garvitkarnwal70177 жыл бұрын
getting error unsupported grant type even in the demo code also. :(
@anupniit3 жыл бұрын
Getting error while running on shared hosting.403 - Forbidden: Access is denied. You do not have permission to view this directory or page using the credentials that you supplied.
@khaledsaleh42387 жыл бұрын
Very good explanation Sourav. Do we need to persist the generated token in a Database that way we can always check if it expires or not?.
@souravmondal457 жыл бұрын
yes are right.
@khaledsaleh42387 жыл бұрын
Thanks Sourav. Another question I have please, In the tutorial you used Bearer authentication, in my case I want the client of my API just send the token and I can validate it against the token I have on the database. Is there another type of Authentication or shall I keep it as simple as get the token from the header and compare it to the token in the DB?.
@wilmanherrera52817 жыл бұрын
Hello Sourav. I have a question. I need implement Two-Factor Authentication into Authentication logic. How could I do it??? I need a lot of ideas....
@8787Sergei5 жыл бұрын
Hello! how to send token from mvc?
@ameysaitavdekar41024 жыл бұрын
Great Tutorial.Explanation was upto the mark.
@sivamurugan83042 жыл бұрын
Super video sourav, i have a doubt , when i hit from my apicontroller as specified in below code, var tokenresponse = await objhttpclient.PostAsync(baseurl + "/token", new FormUrlEncodedContent(form)); whether it wll hit Applicationoauthprovider class grantresourceownercredentials()? Anybody has idea to solve the above myth?
@NaveenChandraPathak8 жыл бұрын
where the user tokens are stored ??
@amaramarnathreddy44456 жыл бұрын
same code implement and testing postman on authorization to get token given username,password and grant_type but getting error "Invalid client" please any suggestion to slove
@mohammadassad63066 жыл бұрын
getting the same error for me too.!! any suggestion to solve please
@ProperComment7 жыл бұрын
I m getting stuck at 24:21 cant see the method HandleUnauthorizedReqest Cant see t
@Eric-iq9xk6 жыл бұрын
Use OnAuthorization method and then: if (HttpContext.Current.User.Identity.IsAuthenticated){base.OnAuthorization(actionContext);}else ....
@Amol1757 жыл бұрын
How to authenticate two different types of user like admin and customers
@jyotipaliwal31417 жыл бұрын
Hi, Tussi gr8 simple & gr8 ho btw, what overall I understood that if you are applying 3 leg authentication than this part (of authentication and providing the access token) will be with 3rd party authorization provider like gmail or facebook. Correct?
@ganirban827 жыл бұрын
Hlw Jyoti, U can use a third party STS(authentication server) app like "identityserver3" to urs project. "identityserver3" supports other social logins like FB, GMAIL. Pls chk the web link below www.scottbrady91.com/Identity-Server/Identity-Server-3-Standalone-Implementation-Part-1
@khwong985 жыл бұрын
Great presentation and illustration.
@sangthanh24907 жыл бұрын
It is very helpful for me. But can you guide for me how to built a form Login use Token based authentication and only jquery because my boss do not want to use postman and AngularJS. Thank you so much
@aaronedwards10176 жыл бұрын
Works like a charm. However, I have a problem. We are integrating Help Pages into our application (docs.microsoft.com/en-us/aspnet/web-api/overview/getting-started-with-aspnet-web-api/creating-api-help-pages). We need to be able to restrict access to the help page to only logged in users. I added ASP.NET Identity to accomplish this. But it seems that the ASP.NET Identity classes (ApplicationUserManager, ApplicationSigninManager etc.) don't play nice with Owin classes in this tutorial. To see what I mean, add a webapi help page using the above link, then try to lock down that controller with [Authorize].
@JoseGomez-qw2gi7 жыл бұрын
Can you help me? I'm trying to add a method POST to your app but my value always is null, all method GET works fine this is the method. Need I move something on the Startup? [HttpPost] [Route("api/cobro/saveEmail/{email}")] public IHttpActionResult SaveEmailForDiscount( string email) { //do something with e-mail return Ok(email); }
@arulmanivannan91307 жыл бұрын
try putting api/cobro/saveEmail?email=sample@email.com this will be a temporary fix as u need to check on routing for permanent fix
@shahidwani64457 жыл бұрын
can u please make videos on how to implement iprincipal
@Rahulsapkota7 жыл бұрын
Please make a client app and call all the methods from client app. Because when i tried to call token method it's throwing me error of cors.
@modnystyl20137 жыл бұрын
Very good and well explained tutorial for everybody which needs helps with TOKEN authentication. Step by step explained. Thank You!
@callegarip8 жыл бұрын
Nice video tutorial. I am having a problem everything works except when I request a token. When I put in Postman the localhost:port/token, it return the html of my site. The status is 200 OK. But I do not see the access token json. What do you think I am missing? Thanks
@happysoul11563 жыл бұрын
Even same error I am facing now
@kuhan18707 жыл бұрын
Hello from the UK, nice video, step by step, very useful :)
@SureshKumar-cj9iz5 жыл бұрын
Good post for static(explicit) data. Can you please put a post for dynamic(implicit) data i.e., retrieving data from the database using Token based authentication in ASP.NET Web API .
@souravmondal455 жыл бұрын
I have shown you with the static data for making the tutorial simple and easy to understand. You can just write query for fetching data from database here in the GrantResourceOwnerCredentials method.
@SureshKumar-cj9iz5 жыл бұрын
@@souravmondal45 Oh, thank you!
@kassemsirine3855 жыл бұрын
Thank you so much this worked perfectly for me, but I'm blocked on how to use this method using data retrieved from a Login View that i created instead of using Postman. I really hope you can explain that part
@manikantameduri36545 жыл бұрын
could you please provide the link of part 2 of this video?
@souravmondal455 жыл бұрын
kzbin.info/www/bejne/n2Oxp4SohJxopNE
@vinodcd7 жыл бұрын
Thank you very much Sourav. I was researching on this and your video has everything I'm looking for to get a start.
@muhallidinwali48388 жыл бұрын
I got error { "error":"unsupported_grant_type"} Can u please help me on this
@arulmanivannan91307 жыл бұрын
Am also facing this issue, would be very helpful if @sourav mondal sir guides.
@UriGolberg2 жыл бұрын
@@arulmanivannan9130 @sourav Did you solve the problem?
@arulmanivannan91302 жыл бұрын
@@UriGolberg yes. Pls see my other comment here
@ehsankeshtgar67344 жыл бұрын
Hi , Thanks for the video . I've implemented your solution , however when I run token url , I get the error " invalid_grant" . could you please advise how to resolve it ?
@souravmondal454 жыл бұрын
as per the tutorial, invalid_grant should came only when GrantResourceOwnerCredentials fails to validate user credential. please recheck the code where you are validating user credential.
@ehsankeshtgar67344 жыл бұрын
@@souravmondal45 Thanks mate. I was omitting one line of your code . It's working fine now . I have another question that you might know the answer though . I have a website that uses Microsoft login functionality. So user needs to put his office 365 credentials in microsoft popup to login. I want to expose the WEB APPs in this website, however when I call these APIs via postman, it fails . The response is the same html of microsoft login , so it actually asks for Microsoft login credentials even through postman . Do you know if there is any way to expose such APIs ? Very thanks in advanced.
@shahidwani64457 жыл бұрын
How to do same in .net core 2.0 web api
@shrikantchavan68568 жыл бұрын
very nice explanation, please provide 2nd part asap.
@souravmondal458 жыл бұрын
kzbin.info/www/bejne/n2Oxp4SohJxopNE
@HemantKumar-yk2jk8 жыл бұрын
Dear Saurav, I am getting below error while executing request using postman tool. i am not sure what i need to check here. ******************************************************************************** Value cannot be null. Parameter name: value body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } pre {font-family:"Consolas","Lucida Console",Monospace;font-size:11pt;margin:0;padding:0.5em;line-height:14pt} .marker {font-weight: bold; color: black;text-decoration: none;} .version {color: gray;} .error {margin-bottom: 10px;} .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; } @media screen and (max-width: 639px) { pre { width: 440px; overflow: auto; white-space: pre-wrap; word-wrap: break-word; } } @media screen and (max-width: 479px) { pre { width: 280px; } } Server Error in '/' Application. Value cannot be null. Parameter name: value Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentNullException: Value cannot be null. Parameter name: value Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [ArgumentNullException: Value cannot be null. Parameter name: value] System.IO.BinaryWriter.Write(String value) +11476865 Microsoft.Owin.Security.DataHandler.Serializer.TicketSerializer.Write(BinaryWriter writer, AuthenticationTicket model) +97 Microsoft.Owin.Security.DataHandler.Serializer.TicketSerializer.Serialize(AuthenticationTicket model) +161 Microsoft.Owin.Security.DataHandler.SecureDataFormat`1.Protect(TData data) +45 Microsoft.Owin.Security.Infrastructure.AuthenticationTokenCreateContext.SerializeTicket() +16 Microsoft.Owin.Security.OAuth.<InvokeTokenEndpointAsync>d__22.MoveNext() +4114 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58 System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) +11522180 Microsoft.Owin.Security.OAuth.<InvokeAsync>d__0.MoveNext() +1109 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58 Microsoft.Owin.Security.Infrastructure.<Invoke>d__0.MoveNext() +383 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58 Microsoft.Owin.Cors.<Invoke>d__0.MoveNext() +691 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58 Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.<RunApp>d__5.MoveNext() +187 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58 Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.<DoFinalWork>d__2.MoveNext() +185 Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.StageAsyncResult.End(IAsyncResult ar) +69 Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContext.EndFinalWork(IAsyncResult ar) +64 System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +380 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155 Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1055.0
@arulmanivannan91307 жыл бұрын
Check the references have been added properly from nuget packages sir.
@Naveen-qy2hw6 жыл бұрын
mistake at 38:42 returns 401 Unauthorized not 403 because you created Aurthorize attribute with the same of framework, so it consider it as framework of default behaviour...you should change the different name for your CustomAuthorize inheritance form Authorize attribute. update it as early as atleast patch video
@charankumarc73054 жыл бұрын
Thanks so much .u good teach .Every one understand easily.good job sir
@kstudio3685 жыл бұрын
how about refresh token?
@cosmarvv50004 жыл бұрын
Very good explanation. Thanks
@loknadh69696 жыл бұрын
Hi Sourav. grate tutorial. I have issue. every time I getting 403 forbidden error (api/data/authenticate call) even I am giving proper token (after token call). Please help me out.
@Eric-iq9xk6 жыл бұрын
In AuthorizeAttribute.cs, use OnAuthorization method and then: if (HttpContext.Current.User.Identity.IsAuthenticated){base.OnAuthorization(actionContext);}else ....
@govindkumar-iu4jh6 жыл бұрын
how can validate user on client side
@def39807 жыл бұрын
How can logout with this implementation? You hav an example??
@souravmondal457 жыл бұрын
Just delete your token. You can see the next part of this video kzbin.info?o=U&video_id=i2NvQrO75no Here I have done all.
@walugembe4 жыл бұрын
Thanks for this straightforward example. I've learnt a lot.
@ronyrodriguez44727 жыл бұрын
Microsoft.Owin 3.1.0 is not compatible with netcoreapp1.0
@GiovanniPerri4 жыл бұрын
Thank you so much for the valuable information, with your help I solved a difficult situation.
@amansingh46464 жыл бұрын
Awesome video bro
@riyayoutuber9126 Жыл бұрын
Microsoft.Web.Services3.Security.SecurityFault: The security token could not be authenticated or authorized ---> System.InvalidOperationException: WSE563: The computed password digest doesn"t match that of the incoming username token. at Microsoft.Web. ........??how to solve this problem ???
@sameer7957 жыл бұрын
i am getting {"error": "invalid_grant"} even though it never reaches the block to set the error.
@souravmondal457 жыл бұрын
have you passed grant_type="password" parameter?
@sameer7957 жыл бұрын
I actually missed to pass the user to validate, that's why I was unable to login.. By the way, thanks for the great tutorial.. Helped me understand that sometimes I need to look places
@souravmondal457 жыл бұрын
Welcome. Thanks for watching my videos. Keep watching for more useful videos.
@rajthakur33077 жыл бұрын
can we use oauth2.0 with jwt(json web token)
@ganirban827 жыл бұрын
Hlw Raj, We can use IdentityServer3 app. This third party app(Written on asp.net-webApi) is already implemented Oauth2(authorization) and OpenId(Authentication) for token based Authentication-authorization process for client like server tech , or browser agent tech application. Pls chk the below web link. www.scottbrady91.com/Identity-Server/Identity-Server-3-Standalone-Implementation-Part-1
@arulmanivannan91307 жыл бұрын
Kind help required sir, am getting invalid_grant error in postman. Also can someone help?
@arulmanivannan91307 жыл бұрын
Made a silly error by not passing identity in context.Validated() method @40:13. Sorry. Your tutorial is working like charm.
@anabel8453 жыл бұрын
Thank you so much. Make vdo about refresh Token please!
@krr44838 жыл бұрын
hi sir,can you please upload token based authentication using web api with database as soon as possible Thnaking You
@SunilMehta1317 жыл бұрын
Good video, It would have been even better if you'd explained things a little more like AuthServerProvider class and its functions, what are all other methods, when to use what. How to setup it with SSL because that's what we will use in the real world.
@bl8nc5 жыл бұрын
Thanks for the video! I was receiving {invalid-grant} even after auth success. At 40: 13 I needed to add var ticket = new AuthenticationTicket(identity, null); context.Validated(ticket); at the end of the GrantResourceOwnerCredentials method to get it to return a token
@suppumahendra83045 жыл бұрын
Hi,its good information, could you please provide one more video for "Token based authentication using asp/net web api and angular 6
@souravmondal455 жыл бұрын
kzbin.info/www/bejne/n2Oxp4SohJxopNE
@shashisagarshrestha14102 жыл бұрын
how to convert jwt authentication.
@radhasimgh15284 жыл бұрын
good knowledge you have shared.thanks
@farooqahmed15523 жыл бұрын
Gr8 SirJee ! really appreciated.
@ananthr86488 жыл бұрын
Nice video ..can please tell me where i can set (grant_type) bcoz i am getting bad Request
@souravmondal458 жыл бұрын
+Ananth r in the js file you can see the below code I have used for login , here we have added grant_type fac.login = function (user) { var obj = { 'username': user.username, 'password': user.password, 'grant_type': 'password' }; Object.toparams = function ObjectsToParams(obj) { var p = []; for (var key in obj) { p.push(key + '=' + encodeURIComponent(obj[key])); } return p.join('&'); }..........
@syedqayyumsyedyusuf21407 жыл бұрын
looks like you are reading it from paper... but it was helpful thanks..
@sarjukabariya12238 жыл бұрын
I am waiting for AngularJs2 with same autnetication implementation.