Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- services.AddIdentityServer()
- //.AddDeveloperSigningCredential()
- .AddSigningCredential(Certificate.GetCertificate())
- .AddInMemoryIdentityResources(Config.GetIdentityResources())
- .AddInMemoryApiResources(Config.GetApiResources())
- .AddInMemoryClients(Config.GetClients())
- .AddTestUsers(Config.GetUsers());
- new Client
- {
- ClientId = "client",
- ClientName = "client",
- ClientSecrets =
- {
- new Secret("secret".Sha256())
- },
- RequireClientSecret = false,
- RedirectUris = new List<string>(new string[] { "https://www.getpostman.com/oauth2/callback", "http://localhost:8002", "http://192.168.1.5:8002","app.buyingagent:/oauthredirect"}),
- AllowedGrantTypes = GrantTypes.Code,
- //RequirePkce = true,
- AllowedScopes = { "api" },
- AllowOfflineAccess = true
- }
- public static X509Certificate2 GetCertificate()
- {
- using (var store = new X509Store(StoreName.Root, StoreLocation.LocalMachine))
- {
- store.Open(OpenFlags.OpenExistingOnly);
- var certs = store.Certificates.Find(X509FindType.FindBySubjectName, "cert", false);
- return certs.Count > 0 ? certs[0] : null;
- }
- }
- POST http://{url}/connect/token
- Request Headers:
- undefined:undefined
- Request Body:
- grant_type:"authorization_code"
- code:"7cb58d345975af02332f2b67cb71958ba0a48c391e34edabd0d9dd1500e3f24e"
- redirect_uri:"https://identity.buyingagentapp.com/connect/token"
- client_id:"client"
- Response Headers:
- undefined:undefined
- Response Body:
- error:"invalid_grant"
- invalid_grant
- Error
Add Comment
Please, Sign In to add comment