IdentityServer4学习(一)定义身份资源
public static IEnumerable<IdentityResource> GetIdentityResources() { return new List<IdentityResource> { new IdentityResource( name: "openid", userClaims: new[] { "sub" }, displayName: "Your user identifier") }; }
public static IEnumerable<IdentityResource> GetIdentityResources() { return new List<IdentityResource> { new IdentityResources.OpenId() }; }
public class ResourceStore : IResourceStore { /// <summary> /// The DbContext. /// </summary> protected readonly IConfigurationDbContext Context; /// <summary> /// The logger. /// </summary> protected readonly ILogger<ResourceStore> Logger; /// <summary> /// Initializes a new instance of the <see cref="ResourceStore"/> class. /// </summary> /// <param name="context">The context.</param> /// <param name="logger">The logger.</param> /// <exception cref="ArgumentNullException">context</exception> public ResourceStore(IConfigurationDbContext context, ILogger<ResourceStore> logger) { Context = context ?? throw new ArgumentNullException(nameof(context)); Logger = logger; } ... }
public static IEnumerable<IdentityResource> GetIdentityResources() { return new List<IdentityResource> { new IdentityResource( name: "profile", userClaims: new[] { "name", "email", "website" }, displayName: "Your profile data") }; }
var client = new Client { ClientId = "client", AllowedScopes = { "openid", "profile" } };
constructor () { super({ authority: 'http://localhost:5000/', client_id: 'vuejs', redirect_uri: 'http://192.168.1.26:8081/callback', response_type: 'id_token token', scope: 'openid profile roles ', post_logout_redirect_uri: 'http://192.168.1.26:8081' }) }