Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OWIN AuthorizeEndpoint with redirect_uri different than uri of web api

I am successfully using bearer token authentication for asp.net web API as is demonstrated in the default single page application template. But now I want to use the same web API from a different site (a different url).

When I make a request to web API AuthorizeEndpoint(by default /api/Account/ExternalLogin) from different site, I get error: invalid_request. I guess the problem is in the redirect_uri value, since changing that to value of site running on same domain as web api resolves the problem.

ValidateClientRedirectUri method in application OAuthAuthorizationServerProvider doesn't get fired. So based on my search in Katana source the error origin is in OAuthAuthorizationServerHandler.InvokeAuthorizeEndpointAsync.

Does anyone else have the same problems or am I doing something wrong?

like image 419
uross Avatar asked Feb 09 '14 23:02

uross


1 Answers

The Katana OAuth middleware is not designed to be cross application - it is mainly for "embedding" an OAuth authorization server into the business resource.

If you want a proper (free) authorization server - have a look here: https://github.com/thinktecture/Thinktecture.AuthorizationServer/wiki

like image 187
leastprivilege Avatar answered Nov 04 '22 14:11

leastprivilege