404 Not Find When using Owin with OAuth

Source: Internet
Author: User
Tags oauth

When using Owin+oauth, step-by-step testing is

Oauthoptions = new Oauthauthorizationserveroptions

{

Tokenendpointpath = new PathString ("/token"),

Provider = new Applicationoauthprovider (Publicclientid),

Authorizeendpointpath = new PathString ("/api/account/externallogin"),

Accesstokenexpiretimespan = timespan.fromdays (14)

Allowinsecurehttp = True

};

App. Useoauthbearertokens (oauthoptions); When registering middleware,

The client calls the

var logindata =

{

Grant_type: ' Password ',

Username:self.loginEmail (),

Password:self.loginPassword ()};

$.ajax ({

Type: ' POST ',

URL: '/token ',

Data:logindata}). Done (

function (data) {

Self.user (Data.username);

Cache the access token in session storage.

Sessionstorage.setitem (Tokenkey, Data.access_token);

}). Fail (showerror);

Appears 404. Not fount error, which is obviously/token endpoint does not have a start function. Found on the internet is to put allowinsecurehttp=true open, should be the default HTTPS protocol, if not open it, there is no way to call/token endpoint Service

404 Not Find When using Owin with OAuth

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.