Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using IdentityServer4.Models;
- using IdentityServer4.Test;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Threading.Tasks;
- namespace AspNetCoreIdenityServer4Example
- {
- public class Config
- {
- public static IEnumerable<ApiResource> GetApiResources()
- {
- return new List<ApiResource>
- {
- new ApiResource("api1", "Nossa API")
- };
- }
- public static IEnumerable<Client> GetClients()
- {
- return new List<Client>
- {
- new Client
- {
- ClientId = "password.client",
- AllowedGrantTypes = GrantTypes.ResourceOwnerPassword,
- ClientSecrets =
- {
- new Secret("secret".Sha256())
- },
- AllowedScopes = { "api1" }
- }
- };
- }
- public static List<TestUser> GetUsers()
- {
- return new List<TestUser>
- {
- new TestUser
- {
- SubjectId = "1",
- Username = "manaces",
- Password = "123456"
- },
- new TestUser
- {
- SubjectId = "2",
- Username = "pereira",
- Password = "123456"
- }
- };
- }
- }
- }
Add Comment
Please, Sign In to add comment