This article is a mirror article of machine translation, please click here to jump to the original article.

View: 272527|Reply: 135

[WebAPI] webapi OWIN OAuth 2.0 authenticates user registration and token acquisition

  [Copy link]
Posted on 10/26/2016 2:23:00 PM | | | |

Encapsulation of Web API signatures, verification timestamped random number keys, etc
http://www.itsvse.com/thread-3274-1-1.html
(Source: Architect)
The above way is too old-fashioned...


First, we need to configure the following content:

Tourists, if you want to see the hidden content of this post, pleaseReply


Then, we request the POST request /api/Account/Register interface, as follows:


Requested content:

{
  "Email": "help@itsvse.com",
  "Password": "AAAAa123.",
  "ConfirmPassword": "AAAAa123."
}



Then, the following message was successfully returned:

{
  "Email": "help@itsvse.com",
  "Password": "AAAAa123.",
  "ConfirmPassword": "AAAAa123."
}

Looking at the database, we found that we have successfully registered the user information.



How do I get tokens??????

Let's post interface: http://localhost:1896/token

post content:



Successfully returned the token!!!



{
    "access_token": "QHUVRD6B8BHK7lQMdptgu6moxtI13ZWXeGBFJ8laucq0V8knpuHAqgEvwGNrTvic6purdVftRbN7RGY_St0CFefivYREndybcilSa09btXU741m8Y6D480ISChO5CfnkZgcA7Q0m9WgP-I2Bx9OrwZswDJy5I7F39-tv_ 0nAlTxEYQxNgRwKzGvzMdD98sw5jQTpAlb7TuoVDkuVfIjtn01pQvLO8ZTdgNawgHZNauZeNZT52ZxH2Xx7F_9SBa8qLJKmja9xRVrfNMbPgP-C7L4mGa_1YlRsovn0iIeR6S9h_ TMubEpOIEYffwf00tf0BcxXaWtVo6n-y9yIFa5HGcPfR5lp4luNjAHmGHo03XbVLsHhcRxwGJEChRYxFXGCRO6Yh8Jswtwti67ZlF8QbnyRcqfgcy6ZPC8ZjoWDNMGn-n1KxXBvw06nUhPwW0rhfqZtmXA9VaW6NY7UGe98 _SuLb6n4-AYvxY8z90J3lPvDBBU8acfpJkEUjeSDGao4",
    "token_type": "bearer",
    "expires_in": 1209599,
    "userName": "help@itsvse.com",
    ".issued": "Wed, 26 Oct 2016 06:20:21 GMT",
    ".expires": "Wed, 09 Nov 2016 06:20:21 GMT"
}

Here's how to use the token:
Tourists, if you want to see the hidden content of this post, pleaseReply







Previous:.net/c# post to submit the json data to the server
Next:SQL determines whether a column contains Chinese or English characters
Posted on 1/18/2018 3:08:34 PM |
Find a tutorial similar to the landlord's god. http://www.cnblogs.com/dudu/p/4569857.html from dudu is also good.
ASP.NET WebApi OWIN packages that need to be installed:
Owin
Microsoft.Owin.Host.SystemWeb
Microsoft.Owin.Security.OAuth
Microsoft.Owin.Security.Cookies
Microsoft.AspNet.Identity.Owin
Learn from the landlord and thank the landlord
 Landlord| Posted on 10/26/2016 3:00:37 PM |
https://dotblogs.com.tw/brooke/2014/08/01/146135

http://blog.falafel.com/customize-mvc-5-application-users-using-asp-net-identity-2-0/
Posted on 8/23/2017 1:32:20 PM |
webapi OWIN OAuth 2.0 authenticates user registration and token acquisition
- This article is from the architect, the original address: https://www.itsvse.com/thread-3279-1-1.html
Posted on 10/26/2016 2:43:08 PM |
Good stuff. I want it
 Landlord| Posted on 10/26/2016 2:44:05 PM |

Note First, create a new webapi version 4.5
Posted on 11/22/2016 12:16:53 PM |
 Landlord| Posted on 11/22/2016 12:54:27 PM |

Brother, what are you trying to do?????
Posted on 1/13/2017 1:37:25 PM |
Thank you for sharing, thank you for sharing, thank you for sharing
Posted on 1/13/2017 3:34:55 PM |
Imitate WeChat oauth verification
Posted on 2/23/2017 5:48:21 PM |
sdfsdfsdfsadfsfsadfsa
Posted on 3/14/2017 8:36:17 AM |
Look, novices learn to learn
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com