Stratospheric by Björn Wilmsmann and Philip Riecks Tom Hombergs

Stratospheric by Björn Wilmsmann and Philip Riecks Tom Hombergs

Author:Björn Wilmsmann and Philip Riecks Tom Hombergs [Tom Hombergs, Björn Wilmsmann and Philip Riecks]
Language: eng
Format: mobi
Publisher: leanpub.com
Published: 2020-11-08T00:00:00+00:00


We make both the logoutUrl (representing the logout endpoint of our Cognito instance, e.g. https://stratospheric...amazoncognito/logout) and the clientId (the app client id of our Todo application) configurable, as these depend on the actual Cognito instance.

The logout_uri parameter is the URL that Cognito will redirect the end user to after the logout. This has to be a valid URL that was configured as part of the LogoutURLs of the app client. For our application, we redirect all users to the base URL of the Todo application.

With this custom LogoutSuccessHandler in place, we can now define it as a bean for our aws profile and inject the relevant environment variables to configure the handler:

1 @Configuration 2 public class LogoutSuccessHandlerConfig { 3 4 @Bean 5 @Profile("aws") 6 public LogoutSuccessHandler cognitoOidcLogoutSuccessHandler( 7 @Value("${COGNITO_CLIENT_ID}") String clientId, 8 @Value("${COGNITO_USER_POOL_LOGOUT_URL}") String userPoolLogoutUrl) { 9 return new CognitoOidcLogoutSuccessHandler(userPoolLogoutUrl, clientId); 10 } 11 }



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.