Spring Boot SAML SSO custom JWT token refresh - spring-boot

I have followed below URL to configure SAML SSO to the existing spring boot application, which already have User name - password authentication and JWT authorization for APIs.
https://github.com/pateluday07/saml-sso-and-slo-demo-idp-azure-sp-springboot
Also in onSSOSuccessHandler() I have generated custom JWT token and returned to the Angular front end as cookie. The JWT token expiry set for 1 Hour. The spring boot application is configured with stateless session policy.
On JWT token expiry how we can refresh the token by validating the SSO session? Do we have to call /saml/login endpoint on token expiry?

Related

Spring boot keycloak: How to handle token expiration and refresh token

I am using spring boot security and spring boot keycloak starter to secure rest APIs and authenticate users.
My first question is how to handle access token expiration if user's session is still valid.
The second question is getting the access token from keycloak into spring boot app is done by calling this line
AccessTokenResponse response = authzClient.obtainAccessToken(username, password);
in the same way how to call refresh token api

LDAP Authentication with JWT Spring Boot Application

Currently, I am Using Spring Security with LDAP authentication. But I want to Create one Rest API which will do LDAP authentication and will then I will generate JWT token so for upcoming request I can valid JWT tokens.
Any suggestions to achieve this ?

Spring Security and OneLogin Token Expiration

I am trying to configure an authentication flow in Spring Boot using OneLogin SSO. I can successfully authenticate, create a JWT token, and redirect to my frontend app.
However, I am not certain of the next steps. When my JWT token expires, is the appropriate course to clear my security context and then to redirect to OneLogin again and reconfirm my authentication? Right now, as far as I can tell, Spring's security context represents one moment in time and I can't figure out how to refresh it against my SSO provider to ensure the user is still authenticated.

How to Validate a RSA256 signed JWT token in Spring Boot

I have JWT token which is RSA256 signed. I need to validate this token in my my microservice.
Can anyone give a example of how to implement this using Spring Security.
You can setup a springboot resource server to handle the JWT token and security. Check spring document for resource server

Setting access token to cookie in Spring Security OAuth2

I would like to write OAuth2 access token to a cookie instead of writing to response. Since my OAuth request uses /oauth/token endpoint defined in TokenEndpoint.java of Spring Security OAuth2 module, the token is always written to response.
How can I remove this token from response and set to cookie? Should I implement my own TokenEndpoint?

Resources