简体   繁体   中英

Authorization doesn't work after deployment on azure

Im building a single page app with angularJS and WebApi 2. Im using OAuth bearer token authentication with Owin middleware. While everything works on the localhost,after deployment to Azure I get 401 when trying to access my web api.

Is there additional config on azure? What should i do?

Thx in advance

How did you do your deployment to Azure? Deploying to Azure requires a change in the apps' return URI, to match the new location. If you create a new entry for the app, instead of modifying the existing one with the new return URI, you will get a new clientID. Your backend API verifies incoming tokens based on the clientID value in its web.config: if the clietnID value changes and you don't update it in the web.config before deploying to azure, the token check will fail.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM