-
Created from this other question asked by @veganchamp. I'm getting the exception below
The issuer-uri looks good: {
"issuer": "https://sys-login.lvgig.co.uk/TID/",
"authorization_endpoint": "https://sys-login.lvgig.co.uk/TID/b2c_1a_rpsaveqa3/oauth2/authorize",
...
} |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Spring Boot configuration properties should be set as follow:
Setting just But in your case, it seems that a path segment is missing in Please double check one of your access token If the access token tenant: change-me
# double check that
# - this value is EXACTLY what you get as "iss" claim in tokens (even case and trailing slash are important)
# - OpenID configuration is available from https://sys-login.lvgig.co.uk/${tenant}/B2C_1A_RPSaveQA3/.well-known/openid-configuration
azure-issuer: https://sys-login.lvgig.co.uk/${tenant}/B2C_1A_RPSaveQA3/
spring:
security:
oauth2:
client:
provider:
azure-ad-b2c:
issuer-uri: ${azure-issuer}
# other provider properties are auto-configured by Spring Security from the OpenID configuration If the OpenID configuration cannot be fetched by appending tenant: change-me
# Double-check this values against what you actually get from .well-known/openid-configuration
azure-authorization-endpoint: https://login.microsoftonline.com/${tenant}/oauth2/v2.0/authorize
azure-token-endpoint: https://login.microsoftonline.com/${tenant}/oauth2/v2.0/token
azure-jwks-endpoint: https://login.microsoftonline.com/${tenant}/discovery/v2.0/keys
spring:
security:
oauth2:
client:
provider:
azure-ad-b2c:
jwk-set-uri: ${azure-jwks-endpoint}
authorization-uri: ${azure-authorization-endpoint}
token-uri: ${azure-token-endpoint} |
Beta Was this translation helpful? Give feedback.
-
Hi @ch4mpy, the iss in the claim returned from the token request is: Having looked on our Azure Portal at the "Azure AD B2C" set-up, this is the published endpoint: I've found it needs the query string, the request fails without it so I'm guessing I need to extend your spring-addon's class to modify the issuer-uri to include this parameter? Note, the 'p' parameter ris dynamic based on the user context - there's ~5 options ..SAVE.. / ..RETRIEVE.. etc, they control templated content on the login page. |
Beta Was this translation helpful? Give feedback.
-
No. As stated in the answer above, the issuer-uri must be exactly what you have in tokens as
If the values for other providers properties ( If the other provider parameters change with your As a side note, all this is pure "official" boot configuration and spring-addons does nothing about it. If you want to change something about how providers auto-configuration is performed or tokens validation done, you'll have to open Spring Security source code, look how it is implemented there, and then find a way to change that. |
Beta Was this translation helpful? Give feedback.
Spring Boot configuration properties should be set as follow:
issuer-uri
with what you find in tokens asiss
claim (exactly, even case and trailing slash, if any, are important), but only if OpenID configuration can be found by just adding.well-known/openid-configuration
to it (no added or modifiedpath segment in between)jwk-set-endpoint
,authorization-uri
,token-uri
anduser-info-uri
with what you find in OpenID configuration (what you get fromhttps://sys-login.lvgig.co.uk/TID/B2C_1A_RPSaveQA3/.well-known/openid-configuration
)Setting just
issuer-uri
is possible only if the OpenID configuration is available from${issuer-uri}/.well-known/openid-configuration
(or${issuer-uri}.w…