Leon Nicetomeetya
Leon Nicetomeetya

Reputation: 103

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

Upvotes: 1

Views: 1072

Answers (1)

vibronet
vibronet

Reputation: 7394

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.

Upvotes: 0

Related Questions