I’m seeking guidance on how to properly implement the OidcProviderSessionRepository
. I have several questions:
- What is the correct way to implement
OidcProviderSessionRepository
? - Are there any built-in implementations provided by Spring Security?
- If I need to create a custom implementation, which key methods should I implement?
- How would this implementation differ if I were using Redis for session storage?
Here’s a snippet of my current class structure:
@Component
@RequiredArgsConstructor
public final class CustomReactiveOidcSessionRegistry implements ReactiveOidcSessionRegistry {
private final OidcProviderSessionRepository sessions;
@Override
public Mono<void> saveSessionInformation(OidcSessionInformation info) {
return this.sessions.save(info);
}
@Override
public Mono<OidcSessionInformation> removeSessionInformation(String clientSessionId) {
return this.sessions.removeByClientSessionId(clientSessionId);
}
@Override
public Flux<OidcSessionInformation> removeSessionInformation(OidcLogoutToken token) {
return token.getSessionId() != null ?
this.sessions.removeBySessionIdAndIssuerAndAudience(...) :
this.sessions.removeBySubjectAndIssuerAndAudience(...);
}
}
I am unable to find an interface to implement the OidcProviderSessionRepository.
New contributor
Thon Becker is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.