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

Add in openid-connect/auth response_type code #84

Open
awsoremod opened this issue Dec 16, 2024 · 0 comments
Open

Add in openid-connect/auth response_type code #84

awsoremod opened this issue Dec 16, 2024 · 0 comments

Comments

@awsoremod
Copy link
Contributor

awsoremod commented Dec 16, 2024

The endpoint needs to be modified - http://localhost:8080/realms/master/protocol/openid-connect/auth

  1. We need to add a wait in the input parameters response_type=code
  2. The following input parameters are to be expected:
  • client_id
  • state - protection against csrf (to implement within another task)
  • scope - OPTIONAL authorization scope
  • redirect_uri - OPTIONAL is the address to which the browser will be redirected after the user receives the access code. May be when bad request.

Example of a request - http://localhost:8080/realms/master/protocol/openid-connect/auth?response_type=code&client_id=test&state=state_value&scope=offline_access&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Ftest-callback.
If client_id=code, html must be returned.
The HTML must contain a form with fields:

  1. login or email
  2. password

Sample form code:

<form id="kc-form-login" class="pf-v5-c-form" onsubmit="login.disabled = true; return true;" action="http://localhost:8080/realms/master/login-actions/authenticate?session_code=TsJRi4n0YHMDfySRbmcOa3nhAs7sjtciT5PgTpak45s&amp;execution=e60bc341-9a67-4b29-b600-4f13d401985a&amp;client_id=test&amp;tab_id=__1o7N2Hxno&amp;client_data=eyJydSI6Imh0dHA6Ly9sb2NhbGhvc3Q6ODA4MC90ZXN0LWNhbGxiYWNrIiwicnQiOiJjb2RlIiwic3QiOiJzdGF0ZV92YWx1ZSJ9" method="post" novalidate="novalidate">

Cookie installation example:

checkCookiesAndSetTimer(
            "/realms/master/login-actions/restart?client_id=test&tab_id=__1o7N2Hxno&client_data=eyJydSI6Imh0dHA6Ly9sb2NhbGhvc3Q6ODA4MC90ZXN0LWNhbGxiYWNrIiwicnQiOiJjb2RlIiwic3QiOiJzdGF0ZV92YWx1ZSJ9&skip_logout=true"
        );

Need to have the post request sent to http://localhost:8080/realms/master/login-actions/authenticate with the following parameters:

  • session_code - parameter that saves the state of the authentication process. It is not necessary to implement within the task.
  • execution - I don't know what it is. As part of another task.
  • client_id - previous client_id
  • tab_id - A query parameter that specifies how sessions are handled in the background. Implement as part of another task.
  • client_data - TODO need to find out what is being transmitted here and in what format. I haven't found any information. I assume encrypted pair of user login and password.
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

No branches or pull requests

1 participant