Package org.apache.solr.security.jwt
Class JWTIssuerConfig
java.lang.Object
org.apache.solr.security.jwt.JWTIssuerConfig
Holds information about an IdP (issuer), such as issuer ID, JWK url(s), keys etc
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classConfig object for a OpenId Connect well-known config. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJWTIssuerConfig(String name) Create config for further configuration with setters, builder style.JWTIssuerConfig(Map<String, Object> configMap) Initialize issuer config from a generic configuration map -
Method Summary
Modifier and TypeMethodDescriptionasConfig()static voidcheckAllowOutboundHttpConnections(String parameterName, URL url) getAud()List<org.jose4j.jwk.HttpsJwks> getIss()org.jose4j.jwk.JsonWebKeySetgetName()voidinit()Call this to validate and initialize an object which is populated with setters.booleanisValid()Validates that this config has a name and either jwksUrl, wellkKownUrl or jwkprotected voidparseConfigMap(Map<String, Object> configMap) Parses configuration for one IssuerConfig and sets all variables foundprotected static org.jose4j.jwk.JsonWebKeySetparseJwkSet(Map<String, Object> jwkObj) setAuthorizationEndpoint(String authorizationEndpoint) setAuthorizationFlow(String authorizationFlow) setClientId(String clientId) static voidsetHttpsJwksFactory(JWTIssuerConfig.HttpsJwksFactory httpsJwksFactory) Set the factory to use when creating HttpsJwks objectsprotected voidsetJsonWebKeySet(Object jwksObject) Setter that takes a jwk config object, parses it into aJsonWebKeySetand sets itsetJsonWebKeySet(org.jose4j.jwk.JsonWebKeySet jsonWebKeySet) setJwksUrl(Object jwksUrlListOrString) Setter that converts from String or List into a listsetJwksUrl(List<String> jwksUrl) setTokenEndpoint(String tokenEndpoint) voidsetTrustedCerts(Collection<X509Certificate> trustedCerts) setWellKnownUrl(String wellKnownUrl) booleanCheck if the issuer is backed by HttpsJwk url(s)
-
Field Details
-
ALLOW_OUTBOUND_HTTP
public static boolean ALLOW_OUTBOUND_HTTP -
ALLOW_OUTBOUND_HTTP_ERR_MSG
- See Also:
-
-
Constructor Details
-
JWTIssuerConfig
Create config for further configuration with setters, builder style. Once all values are set, callinit()before further use- Parameters:
name- a unique name for this issuer
-
JWTIssuerConfig
Initialize issuer config from a generic configuration map- Parameters:
configMap- map of configuration keys anv values
-
-
Method Details
-
init
public void init()Call this to validate and initialize an object which is populated with setters. Init will fetch wellKnownUrl if relevant- Throws:
org.apache.solr.common.SolrException- if issuer is missing
-
parseConfigMap
Parses configuration for one IssuerConfig and sets all variables found- Throws:
org.apache.solr.common.SolrException- if unknown parameter names found in config
-
setJsonWebKeySet
Setter that takes a jwk config object, parses it into aJsonWebKeySetand sets it- Parameters:
jwksObject- the config object to parse
-
parseJwkSet
protected static org.jose4j.jwk.JsonWebKeySet parseJwkSet(Map<String, Object> jwkObj) throws org.jose4j.lang.JoseException- Throws:
org.jose4j.lang.JoseException
-
getIss
-
setIss
-
getName
-
setName
-
getWellKnownUrl
-
setWellKnownUrl
-
getJwksUrls
-
setJwksUrl
-
setJwksUrl
Setter that converts from String or List into a list- Parameters:
jwksUrlListOrString- object that should be either string or list- Returns:
- this for builder pattern
- Throws:
org.apache.solr.common.SolrException- if wrong type
-
getHttpsJwks
-
setHttpsJwksFactory
Set the factory to use when creating HttpsJwks objects- Parameters:
httpsJwksFactory- factory with custom settings
-
getJsonWebKeySet
public org.jose4j.jwk.JsonWebKeySet getJsonWebKeySet() -
setJsonWebKeySet
-
usesHttpsJwk
public boolean usesHttpsJwk()Check if the issuer is backed by HttpsJwk url(s)- Returns:
- true if keys are fetched over https
-
getWellKnownDiscoveryConfig
-
getAud
-
setAud
-
getClientId
-
setClientId
-
getAuthorizationEndpoint
-
setAuthorizationEndpoint
-
getTokenEndpoint
-
setTokenEndpoint
-
getAuthorizationFlow
-
setAuthorizationFlow
-
asConfig
-
isValid
public boolean isValid()Validates that this config has a name and either jwksUrl, wellkKownUrl or jwk- Returns:
- true if a configuration is found and is valid, otherwise false
- Throws:
org.apache.solr.common.SolrException- if configuration is present but wrong
-
setTrustedCerts
-
getTrustedCerts
-
checkAllowOutboundHttpConnections
-