Skip to content

Instantly share code, notes, and snippets.

@skynyrd
Last active January 5, 2019 05:38
Show Gist options
  • Save skynyrd/73be99879783e589e55bd29ee8986616 to your computer and use it in GitHub Desktop.
Save skynyrd/73be99879783e589e55bd29ee8986616 to your computer and use it in GitHub Desktop.
For medium post about identityserver
public class Config
{
// scopes define the API resources in your system
public static IEnumerable<ApiResource> GetApiResources()
{
return new List<ApiResource>
{
new ApiResource("TheApi", "The Example API")
};
}
// clients want to access resources (aka scopes)
public static IEnumerable<Client> GetClients()
{
// client credentials client
return new List<Client>
{
new Client
{
ClientId = "TheClientId",
AllowedGrantTypes = GrantTypes.ClientCredentials,
ClientSecrets =
{
new Secret("secret".Sha256())
},
AllowedScopes = { "TheApi" }
}
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment