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(jans-auth-server): add ability to propagate session from authz challenge script to grant object #6864

Closed
yuriyz opened this issue Nov 30, 2023 · 0 comments · Fixed by #7978
Assignees
Labels
comp-jans-auth-server Component affected by issue or PR kind-feature Issue or PR is a new feature request
Milestone

Comments

@yuriyz
Copy link
Contributor

yuriyz commented Nov 30, 2023

Description

feat(jans-auth-server): add ability to propagate session from authz challenge script to grant object

Motivation: support 11600

Sample script

scriptLogger.trace("Authentication successful");
        context.getExecutionContext().setUser(user); // <- IMPORTANT : without user set, user relation will not be associated with token
        scriptLogger.trace("User {} is authenticated successfully.", username);

        // 4. referencing ROPC custom param script, need to enable authorizationChallengeShouldGenerateSession
        scriptLogger.trace("Creating Authentication session...");

        SessionIdService sessionIdService = CdiUtil.bean(SessionIdService.class);
        Identity identityService = CdiUtil.bean(Identity.class);

        Map<String, String> sessionStore = new HashMap<String, String>();
        sessionStore.put("login_id_token",login_id_token);
        sessionStore.put("login_access_token",login_access_token);
        sessionStore.put("transaction_status","PENDING");
        SessionId sessionId = sessionIdService.generateAuthenticatedSessionId(context.getHttpRequest(), user.getDn(), sessionStore);

        context.getExecutionContext().setSessionId(sessionId);
        // sessionIdService.updateSessionId(sessionId);
        // identityService.setSessionId(sessionId);
        scriptLogger.trace("Created Authentication session successfully");

It should be references in authorization grant object.
String sessionDn = authorizationGrant.getSessionDn();

@yuriyz yuriyz self-assigned this Nov 30, 2023
@yuriyz yuriyz added kind-feature Issue or PR is a new feature request comp-jans-auth-server Component affected by issue or PR labels Nov 30, 2023
@yuriyz yuriyz added this to the 1.0.21 milestone Nov 30, 2023
@moabu moabu modified the milestones: 1.0.21, 1.0.22 Dec 14, 2023
@moabu moabu modified the milestones: 1.0.22, 1.0.23 Feb 1, 2024
yuriyz added a commit that referenced this issue Mar 6, 2024
… challenge script to grant object #6864

Signed-off-by: YuriyZ <yzabrovarniy@gmail.com>
yuriyz added a commit that referenced this issue Mar 7, 2024
… challenge script to grant object #6864 (#7978)

* feat(jans-auth-server): added ability to propagate session from authz challenge script to grant object #6864

Signed-off-by: YuriyZ <yzabrovarniy@gmail.com>

* feat(jans-auth-server): fixed case when session is prepared by script

Signed-off-by: YuriyZ <yzabrovarniy@gmail.com>

* chore(jans-auth-server): renamed method for clarity

Signed-off-by: YuriyZ <yzabrovarniy@gmail.com>

---------

Signed-off-by: YuriyZ <yzabrovarniy@gmail.com>
yuriyz added a commit that referenced this issue Nov 7, 2024
… challenge script to grant object #6864 (#7978)

* feat(jans-auth-server): added ability to propagate session from authz challenge script to grant object #6864

Signed-off-by: YuriyZ <yzabrovarniy@gmail.com>

* feat(jans-auth-server): fixed case when session is prepared by script

Signed-off-by: YuriyZ <yzabrovarniy@gmail.com>

* chore(jans-auth-server): renamed method for clarity

Signed-off-by: YuriyZ <yzabrovarniy@gmail.com>

---------

Signed-off-by: YuriyZ <yzabrovarniy@gmail.com>
Former-commit-id: e139873
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-jans-auth-server Component affected by issue or PR kind-feature Issue or PR is a new feature request
Projects
None yet
2 participants