Skip to content

B2B Authentication / Authorization #3

Description

@BAEKJungHo

B2B Authentication/Authorization

B2B-Authentication-Authorization-Version2

  • Front 에서 AccessToken 의 유효기간을 판단하여 만료되거나, 만료되기 직전에 authentication-service 로 재발급 요청 하는 로직이 있다고 가정
  • Refresh Token 과 사용자에 대한 관련 정보 및 권한들을 Redis(In-memory storage)에 보관
    • Refresh Token 저장용 Redis 와 사용자/권한 관련 정보를 저장하기 위한 Redis 가 별도로 존재
    • authentication-service Redis 에서는 refresh token 을 저장
    • authorization-service Redis 에서는 User Inforamtion 을 저장 (userId 와 권한정보들을 저장)
  • authorization-service 에서 token 을 검증하고 payload 에서 userId 를 추출한 다음, 해당 ID 값으로 권한을 조회
  • 권한이 변경될 때마다 redis replica 에 들어있는 정보들을 update 쳐준다고 가정
  • 로그아웃을 하거나, 첫 로그인 후 Refresh Token 만료 시간이 지나면 Refresh Token 사용 불가 (Redis 에서 제거 됨)
  • Access Toeken 이 만료되면 Refresh Token 의 유효성과 Redis 의 Refresh Token 존재 유무를 확인한 후 재발급 진행

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

docsDocumentations

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions