Skip to content
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

Feat/stateless auth sso #73

Open
wants to merge 42 commits into
base: main
Choose a base branch
from
Open

Feat/stateless auth sso #73

wants to merge 42 commits into from

Conversation

DelaunayAlex
Copy link
Collaborator

No description provided.

DelaunayAlex and others added 30 commits February 3, 2025 15:03
…O Opaque token and generate session on server side
…O Opaque token and generate session on server side
@@ -54,7 +46,14 @@ spring:
- undertow-https-redirect
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this packaging is not used for local dev only but also for our docker image, do we want ldap by default ?

@DelaunayAlex
Copy link
Collaborator Author

  • Delete logout from server
  • Do not check userDetailsService everytime we validate the jwt token
  • Merge ClientRegistration and custom sso params in application.yml
  • Remove httpbasic from security chain
  • Generate token after login in loginSuccessfulHandler ?
  • Use the object UserDetails instead of serializing the user in claims

return extractClaim(token, Claims::getExpiration);
}

private String createToken(Map<String, Object> claims, String subject) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not forge a token with an local issuer for chutney ? and add chutney authorizations as claims/scopes ?

if (username != null && SecurityContextHolder.getContext().getAuthentication() == null) {
var userDetails = userDetailsServices.stream().map(service -> {
try {
return service.loadUserByUsername(username);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why call the underlying user details service ? You need only to retrieve the chutney authorizations from the corresponding service given the username, i think.

#SPDX-FileCopyrightText: 2017-2024 Enedis
#SPDX-License-Identifier: Apache-2.0

spring:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is all configs required here ? Seems a bit redondant.

@@ -86,6 +86,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-oauth2-client</artifactId>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we not just a resource server ?

oidc:
user-info-uri: "${auth.sso.issuer}/userinfo"

auth:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use chutney. as prefix

- mem-auth
- db-sqlite

auth:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use .chutney prefix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants