module Web.OIDC.Client.Discovery.Provider
(
Provider(..)
, Configuration(..)
) where
import Data.Aeson.TH (deriveFromJSON, Options(..), defaultOptions)
import Data.Aeson.Types (camelTo2)
import Data.Text (Text)
import Jose.Jwk (Jwk)
import Web.OIDC.Client.Types (ScopeValue, IssuerLocation)
data Provider = Provider { configuration :: Configuration, jwkSet :: [Jwk] }
data Configuration = Configuration
{ issuer :: IssuerLocation
, authorizationEndpoint :: Text
, tokenEndpoint :: Text
, userinfoEndpoint :: Maybe Text
, revocationEndpoint :: Maybe Text
, jwksUri :: Text
, responseTypesSupported :: [Text]
, subjectTypesSupported :: [Text]
, idTokenSigningAlgValuesSupported :: [Text]
, scopesSupported :: Maybe [ScopeValue]
, tokenEndpointAuthMethodsSupported :: Maybe [Text]
, claimsSupported :: Maybe [Text]
}
deriving (Show, Eq)
$(deriveFromJSON defaultOptions{fieldLabelModifier = camelTo2 '_'} ''Configuration)