-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for getting end_session_endpoint from OIDC Configuration #5540
Comments
Related #5350 |
@mraible Thanks for the report! There currently is OpenID Connect Discovery code in We'll get this in for 5.1 |
@jgrandja Is it possible to inject the |
@mraible You can pass in the @Autowired
public void setClientRegistrationRepository(ClientRegistrationRepository registrations) {
this.registration = registrations.findByRegistrationId("okta");
} Alternatively you could use public void setClientRegistration(
@Value("#{@clientRegistrationRepository.findByRegistrationId('okta')}") ClientRegistration clientRegistration) {
this.registration = clientRegistration;
} Of course you could take it a step further and just get the endpoint you want: public void setEndpoint(
@Value("#{@clientRegistrationRepository.findByRegistrationId('okta')?.providerDetails?.configurationMetadata['end_session_endpoint']}") String endpoint) {
this.endpoint = endpoint;
} If that is just too much SpEL you can place that into a Bean too: @Component
class OktaMetadata {
ClientRegistrationRepository r;
OktaMetadata(ClientRegistrationRepository r) {
this.r = r;
}
String getEndpoint() {
return (String) this.r.findByRegistrationId("okta").getProviderDetails().getConfigurationMetadata().get(end_session_endpoint");
}
}
public void setEndpoint(
@Value("#{@oktaMetadata.endpoint}") String endpoint) {
this.endpoint = endpoint;
} |
Summary
Okta has an
end_session_endpoint
property that can be used to construct a global logout that happens on the client. Example code here.It would be nice if Spring Security's OIDC support provided a way to access this
end_session_endpoint
. This property is present in./well-known/openid-configuration
.Version
5.1.0.BUILD-SNAPSHOT
Sample
https://github.com/oktadeveloper/okta-spring-boot-react-crud-example/compare/spring-security-5.1
The text was updated successfully, but these errors were encountered: