I have set IdentityServer4 which implements oAuth and OpenId Connect, Simple Implementation looks like this
services.AddIdentityServer()
.AddTemporarySigningCredential()
.AddInMemoryIdentityResources(Config.GetIdentityResources())
.AddInMemoryApiResources(Config.GetApiResources())
.AddInMemoryClients(Config.GetClients())
.AddTestUsers(Config.GetTestUsers());
We have our Clients setup like so:
new Client
{
ClientId = "oauthClient",
ClientName = "Example Client Credentials Client Application",
AllowedGrantTypes = GrantTypes.ClientCredentials,
ClientSecrets = new List<Secret> {
new Secret("superSecretPassword".Sha256())},
AllowedScopes = new List<string> {"customAPI.read"}
}
I'm trying to figure out how to create the login request for a user I'm passing this json in a post body to gain access to an authentication token
{
grant_type:client_credentials,
scope=customAPI.read,
client_id=oauthClient
client_secret=superSecretPassword
}
I'm looking for a way to do this but pass user information assuming I had a
username: admin
password: root
What parameters do I have to modify in my json to login as a user? How do I pass the username, password and what is my Grant_Type?