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

Implementation of Login Process #37

Merged
merged 9 commits into from
Mar 31, 2023
Merged

Implementation of Login Process #37

merged 9 commits into from
Mar 31, 2023

Conversation

Rapter1990
Copy link
Contributor

What I have done so far is based on the implementation of login process.

Here is my work step by step

  1. Implement login method of AuthController with its integration test
  2. Implement login method of AuthService with its junit test

@Rapter1990 Rapter1990 added the feature New feature or request label Mar 23, 2023
@Rapter1990 Rapter1990 self-assigned this Mar 23, 2023
@Rapter1990 Rapter1990 requested a review from agitrubard March 26, 2023 11:48
@Rapter1990 Rapter1990 requested a review from skayikci March 29, 2023 12:24
@skayikci
Copy link
Collaborator

skayikci commented Mar 29, 2023

we want to keep most of these in the jwt token, so can you please revise accordingly?

This is the ticket that i'm talking about:
https://github.com/orgs/afet-yonetim-sistemi/projects/3/views/1?pane=issue&itemId=21288609.
You can check the jwt token from jwt.io.

{
    "message": "success",
    "username": "test1245",
    "accessToken": "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0MTI0NSIsImlhdCI6MTY4MDA5NTUzOCwiZXhwIjoxNjgwMDk1NjU4fQ.nq4aRyqlqVRjYpYs6TTWISCtRHIgqB2F0erbF_DBjFPLywFM9AVSxiNln1UJBQr5B3hfvKTTbK7Npo1lud6fLQ",
    "refreshToken": "b7f31fd6-25f3-49a1-b9f4-7da47737d384",
    "expireDate": 1680095658406,
    "roles": [
        "ROLE_ADMIN"
    ]
}

For example the following is how the token should look like, so that you can remove the fields from the response.:

{
  "sub": "1234567890",
  "iat": 1516239022,
  "exp": 1516239022,
  "username": "admin-user",
  "roles": [
    "ADMIN",
    "SUPER_ADMIN"
  ]
}

@Rapter1990
Copy link
Contributor Author

Rapter1990 commented Mar 29, 2023

@skayikci

I can revise the response object if it should look like this shown below

@Data
@Builder
public class AuthResponse {
    private String accessToken;
    private String refreshToken;
    private Long expireDate;
}

@Rapter1990 Rapter1990 requested a review from skayikci March 30, 2023 21:12
@agitrubard agitrubard merged commit 69d98b8 into main Mar 31, 2023
@agitrubard agitrubard deleted the features/login branch March 31, 2023 19:25
@agitrubard agitrubard modified the milestone: v1.0.0 May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

as a user, I want to login via an user panel I want to login via an admin panel as an institutions admin
3 participants