Skip to content

Instantly share code, notes, and snippets.

@HamidMosalla
Last active December 7, 2017 10:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HamidMosalla/9dd96d531995631896f0ec1582cb47e7 to your computer and use it in GitHub Desktop.
Save HamidMosalla/9dd96d531995631896f0ec1582cb47e7 to your computer and use it in GitHub Desktop.
public class Config
{
public static IEnumerable<Client> GetClients()
{
return new List<Client>
{
new Client
{
ClientId = "client1",
// no interactive user, use the clientid/secret for authentication
AllowedGrantTypes = GrantTypes.ClientCredentials,
// secret for authentication
ClientSecrets =
{
new Secret("123654".Sha256())
},
// scopes that client has access to
AllowedScopes = {"Api1"},
Claims = new[]
{
new Claim("Employee", "Mosalla"),
new Claim("website", "http://hamidmosalla.com")
},
ClientClaimsPrefix = ""
},
new Client
{
ClientId = "ro.client1",
AllowedGrantTypes = GrantTypes.ResourceOwnerPassword,
ClientSecrets =
{
new Secret("123654".Sha256())
},
AllowedScopes = {"Api1"}
}
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment