using IdentityServer4; using IdentityServer4.Models; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace AuthorizeCenter.AuthConfig { public class Config { // scopes define the resources in your system public static IEnumerable GetIdentityResources() { return new List { new IdentityResources.OpenId(), new IdentityResources.Profile(), }; } // clients want to access resources (aka scopes) public static IEnumerable GetClients() { return new List { // OpenID Connect隐式流客户端(MVC) new Client { ClientId = "EAP", ClientName = "EAP Web Client", AllowedGrantTypes = GrantTypes.Implicit,//隐式方式 RequireConsent=false,//如果不需要显示否同意授权 页面 这里就设置为false RedirectUris = { "http://localhost:5555/signin-oidc" },//登录成功后返回的客户端地址 PostLogoutRedirectUris = { "http://localhost:5555/signout-callback-oidc" },//注销登录后返回的客户端地址 AllowedScopes =//下面这两个必须要加吧 不太明白啥意思 { IdentityServerConstants.StandardScopes.OpenId, IdentityServerConstants.StandardScopes.Profile } } }; } } }