Hi Dennis,
I had the config setting wrong in the last post, it should be /home
not /api/home
<add key="oauth.credentials.CallbackUrl" value="/home" />
I could not get the redirect to work without adjusting the code in
AuthService.cs OnPost method by moving the referrerUrl variable to
before !isAuthorized check and added a redirect after the call to the
oAuthConfig.Authenticate, (needs some error checking to make sure the
authenticate method was successful).
Does this look like a bug or am I using the service wrong ?
Code is below
var referrerUrl = request.Continue
?? session.ReferrerUrl
?? this.RequestContext.GetHeader("Referer")
?? oAuthConfig.CallbackUrl;
if (!oAuthConfig.IsAuthorized(session,
session.GetOAuthTokens(provider), request))
{
var ret = oAuthConfig.Authenticate(this, session, request) as
AuthResponse;
return this.Redirect(referrerUrl.AddHashParam("s", "0"));
}
//Already Authenticated
if (base.RequestContext.ResponseContentType == ContentType.Html)
return this.Redirect(referrerUrl.AddHashParam("s", "0"));