Last active
January 5, 2019 05:38
-
-
Save skynyrd/73be99879783e589e55bd29ee8986616 to your computer and use it in GitHub Desktop.
For medium post about identityserver
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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