Closed vsavic closed 6 years ago
Try :
[Authenticate(IdentityServerAuthProvider.Name)]
When I change it to that, I'm getting:
{
"responseStatus": {
"errorCode": "Exception",
"message": "No registered Auth Providers found matching IdentityServer provider"
}
}
Can you provide your configuration setup?
Here you go:
public class Startup
{
//...
public override void Configure(Container container)
{
//...
Plugins.Add(new IdentityServerAuthFeature
{
AuthProviderType = IdentityServerAuthProviderType.UserAuthProvider,
AuthRealm = AppSettings.Get<IdentityServer>("IdentityServer").Url, // The URL of the IdentityServer instance
ClientId = AppSettings.Get<IdentityServer>("IdentityServer").ClientId, // The Client Identifier so that IdentityServer can identify the service
ClientSecret = AppSettings.Get<IdentityServer>("IdentityServer").ClientSecret, // The Client Secret so that IdentityServer can authorize the service
Scopes = "openid"
});
}
//...
}
I just saw some additional info on startup error:
ConfigurationException appHost.Config.WebHostUrl must be set to use the Identity Server User Login plugin so that the service can sent it's full http://url:port to the Identity Server User Login
So, everything was fine with this, it was just my configuration issue, I forgot to add WebHostUrl
.
I'm trying to run this identity server auth with core, but when I add
[Authenticate]
attribute and try to invoke my method, I'm getting this as response: