Skip to content

saml 로그인 관련 기능수정#25

Merged
jschoiRR merged 2 commits intoablecloud-team:ablestack-diplofrom
sjyu1:ablestack-diplo
Aug 14, 2025
Merged

saml 로그인 관련 기능수정#25
jschoiRR merged 2 commits intoablecloud-team:ablestack-diplofrom
sjyu1:ablestack-diplo

Conversation

@sjyu1
Copy link
Copy Markdown

@sjyu1 sjyu1 commented Aug 13, 2025

PR 설명

saml 로그인 관련 기능수정

  • saml 설정시, saml 세션이 존재하지 않는 경우 saml 로그인화면으로 가는 이슈 -> wall 로그인 화면으로 이동하도록 수정

  • saml 로그인 후, 로그아웃시 saml 세션 로그아웃 되도록 수정

  • grafana db 컬럼추가(user_auth_token 테이블에 id_token)
    sudo systemctl stop grafana-server
    cp ./data/grafana.db grafana.db.backup
    sqlite3 grafana.db
    ALTER TABLE user_auth_token ADD COLUMN id_token TEXT;
    .schema user_auth_token
    sudo systemctl start grafana-server

wall 관련 sso login

wall 계정 생성(SAML SSO 계정생성)

  • keycloak에 계정 생성 후 wall 첫 로그인시, wall 계정 자동생성

wall

  • wall(/usr/share/ablestack/ablestack-wall/grafana/conf/defaults.ini)

[auth]
signout_redirect_url = http://[wall]/login?disableAutoLogin=true
signout_url = http://[keycloak]/realms/[realms]/protocol/openid-connect/logout

[auth.generic_oauth]
enabled = true
name = Keycloak
allow_sign_up = true
client_id = grafana
client_secret = [client sectet]
auth_url = http://[keycloak]/realms/[realms]/protocol/openid-connect/auth
token_url = http://[keycloak]/realms/[realms]/protocol/openid-connect/token
api_url = http://[keycloak]/realms/[realms]/protocol/openid-connect/userinfo
scopes = openid profile email
login_attribute_path = preferred_username
email_attribute_path = email
role_attribute_path = contains(roles[*], 'grafana-admin') && 'Admin' || 'Viewer'
auto_login = true

  • systemctl restart grafana-server.service

keycloak

Client

  • Client type : OpenID Connect
  • Client ID : grafana
  • Root URl : http://[wall]
  • Valid redirect URLs : http://[wall]/login/generic_oauth, http://[wall]/login*
  • Roles > Create role
    • grafana-admin

Client scope

  • Create client scope(name: roles, type: default, protocol: OpenID Connect, Include in token scope : On)
  • Mappers 탭 > Add mapper > Configure a new mapper : User Client Role
  • User Client Role(Client ID : grafana, Multivalued : On, Token Claim Name : roles, Add to ID token : On, Add to access token : On, Add to userinfo : On)

Client

  • Client scopes 탭 > Add client scope > roles 선택

Users

  • 계정선택 > Role mapping > Assign role > grafana grafana-admin 선택

변경 구분

  • 잠재적 기능/오류 개선 (기존의 기능에 잠재되어 있는 오류 또는 다른 기능에 영향을 미칠 기능의 개선)
  • 새로운 기능 (다른 기능에 영향을 미치지 않는 새 기능)
  • 버그 수정 (이슈에 보고된 버그에 대한 수정으로 다른 기능에 영향을 미치지 않음)
  • 기능 개선 (기존 기능에 대한 개선으로 다른 기능에 영향을 미치지 않음)
  • 코드 청소 (코드 재구성 및 청소, 테스트 케이스 추가 등)

기능/개선 규모 또는 버그 심각도

기능/개선 규모

  • 주요 기능/개선
  • 소규모 기능/개선

버그 심각도

  • 매우 심각 (제품 출시/운영을 불가능하게 함)
  • 위험 (사용자에게 자원의 손실을 가져오게 함)
  • 중요 (사용자에게 기능 사용의 불편을 가져오게 함)
  • 보통 (사용자가 문제를 인지할 수 있을 정도임)
  • 미미 (사용자가 인지하지 못할 정도임)

스크린샷

테스트 방법 및 결과

@jschoiRR jschoiRR merged commit 8249e33 into ablecloud-team:ablestack-diplo Aug 14, 2025
2 of 12 checks passed
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.

2 participants