2020-08-28 13:32:15 -04:00
|
|
|
|
using IdentityServer4;
|
|
|
|
|
|
using IdentityServer4.Models;
|
|
|
|
|
|
using System.Collections.Generic;
|
2021-02-22 15:35:16 -06:00
|
|
|
|
using Bit.Core.Settings;
|
2020-08-28 13:32:15 -04:00
|
|
|
|
|
|
|
|
|
|
namespace Bit.Core.IdentityServer
|
|
|
|
|
|
{
|
|
|
|
|
|
public class OidcIdentityClient : Client
|
|
|
|
|
|
{
|
|
|
|
|
|
public OidcIdentityClient(GlobalSettings globalSettings)
|
|
|
|
|
|
{
|
|
|
|
|
|
ClientId = "oidc-identity";
|
|
|
|
|
|
RequireClientSecret = true;
|
|
|
|
|
|
RequirePkce = true;
|
|
|
|
|
|
ClientSecrets = new List<Secret> { new Secret(globalSettings.OidcIdentityClientKey.Sha256()) };
|
|
|
|
|
|
AllowedScopes = new string[]
|
|
|
|
|
|
{
|
2021-01-11 11:03:46 -05:00
|
|
|
|
IdentityServerConstants.StandardScopes.OpenId,
|
|
|
|
|
|
IdentityServerConstants.StandardScopes.Profile
|
2020-08-28 13:32:15 -04:00
|
|
|
|
};
|
|
|
|
|
|
AllowedGrantTypes = GrantTypes.Code;
|
|
|
|
|
|
Enabled = true;
|
|
|
|
|
|
RedirectUris = new List<string> { $"{globalSettings.BaseServiceUri.Identity}/signin-oidc" };
|
|
|
|
|
|
RequireConsent = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|