servicestack-authentication-identityserver icon indicating copy to clipboard operation
servicestack-authentication-identityserver copied to clipboard

Error in redirect if you call directly auth/IdentityServer

Open alistefano opened this issue 7 years ago • 3 comments
trafficstars

Hi, I noticed that if you call directly the endpoint auth/IdentityServer the webservice not redirects to Identity Server

Steps to reproduce:

  • Create a new empty SS instance with a protected endpoint with a simply [Authenticate] Tag
  • Basic plugin configuration: Plugins.Add(new IdentityServerAuthFeature { AuthProviderType = IdentityServerAuthProviderType.UserAuthProvider, AuthRealm = "http://localhost:5000/", ClientId = "xxxxx", ClientSecret = "xxxxx", Scopes = "openid" });
  • Start the webservice

If you call directly auth/IdentityServer -> error if you call first the protected endpoint and after auth/IdentityServer -> the redirect works

alistefano avatar Jan 03 '18 00:01 alistefano

Calling the endpoint directly isn’t a valid scenario as identity server requires an endpoint to return to.

stuartbfs avatar Jan 03 '18 05:01 stuartbfs

All other oauth providers (Facebook, Twitter, etc) redirect correctly to theirs identity endpoints You can try them by configuring any auth provider and call directly the endpoint

http://yourwebservice.url/auth/facebook http://yourwebservice.url/auth/twitter ...

If no redirects are configured in the connect url they return to default ss metadata page. This should be the standard behavior of the servicestack auth providers.

The current behavior could be a problem if you need to authenticate a client directly, without first calling a protected endpoint

alistefano avatar Jan 03 '18 12:01 alistefano

Identity server implements openid connect so isn't necessarily going to have the same workflow as the other oauth providers. Can I check why you would want to authenticate a client then not call a protected endpoint?

stuartbfs avatar Jan 03 '18 13:01 stuartbfs