ข้ามไปยังเนื้อหาหลัก

Okta Portal SSO

ใช้ Okta เป็น Identity Provider เพื่อเข้าสู่ระบบ Halo portal โดยใช้ SSO

ข้อกำหนดเบื้องต้น

  • เซิร์ฟเวอร์การให้สิทธิ์ Okta ที่กำหนดค่าสำหรับ Halo แล้ว (ดู Okta Authorization Server)

ลงทะเบียนแอปของคุณใน Okta

สร้าง app integration

  1. เข้าสู่ระบบ Okta Admin Console → ไปที่ Applications -> Applications.
  2. คลิก Create App Integration → เลือก OIDC - OpenID Connect.
  3. คลิก Single-Page Application.

image.png

กำหนดค่า app integration

  1. Configure the following settings:
    • ชื่อ app integration: เช่น Glasswall Halo Portal
    • Grant type: Choose below 3 options
      • Authorization Code
      • Refresh Token
      • Implicit (hybrid)
    • Sign-in redirect URIs: เช่น https://<your-halo-domain>/authentication/login-callback
    • Sign-out redirect URIs: เช่น https://<your-halo-domain>/authentication/logout-callback
    • การเข้าถึงแบบควบคุม: เลือก Allow everyone in your organization to access หรือเลือกเฉพาะบางกลุ่มหากคุณต้องการจำกัดการเข้าถึงให้กับคนเพียงไม่กี่คน
    • ยกเลิกการเลือก Enable immediate access with Federation Broker Mode.

Screenshot: Halo Portal Client Screenshot: Halo Portal Client

บันทึกแอปพลิเคชันและจดบันทึก client ID

  1. บันทึก Application และจดบันทึก Client ID.

    export PORTAL_CLIENT_ID=""

Screenshot: Portal client id

ให้สิทธิ์ API scopes

  1. Navigate to Okta API Scopes tab in the application and grant below scopes.
    • okta.myAccount.email.read
    • okta.myAccount.profile.read
    • okta.users.read
    • okta.users.read.self

Screenshots: Portal Okta API Scopes

จดบันทึก issuer URI และ audience

  1. จาก authorization server ที่กำหนดค่าไว้ในขั้นตอนข้อกำหนดเบื้องต้น ให้จดบันทึก Issuer Metadata URI และ VALID_AUDIENCE:

    export OKTA_ISSUER_URI="https://<your-okta-domain>/oauth2/<authorization-server-id>"
    export OKTA_ORIGIN="https://<your-okta-domain>"
    export VALID_AUDIENCE="api://halo"

เพิ่ม access policy สำหรับ portal

  1. ไปที่แท็บ Access Policies ของ authorization server (Security -> API -> เลือก authorization server ของคุณ -> Access Policies)
  2. Add a new access policy:
    • ชื่อ: ตัวอย่างเช่น Portal SSO Access
    • คำอธิบาย: ตัวอย่างเช่น Access policy for Halo Portal SSO users
    • กำหนดให้กับ: ไคลเอนต์ Portal SPA ที่สร้างไว้ด้านบน (ค้นหาตามชื่อ Glasswall Halo Portal)
  3. Add a rule:
    • ชื่อ: ตัวอย่างเช่น Allow Portal Users
    • ประเภทการให้สิทธิ์: Authorization Code
    • ผู้ใช้เป็นสมาชิกของ: Everyone (หรือจำกัดไว้ที่กลุ่มเฉพาะ เช่น Halo-Admin หากคุณต้องการจำกัดการเข้าถึง Portal)
    • ปล่อยการตั้งค่าอื่น ๆ ไว้เป็นค่าเริ่มต้น หรือปรับตามต้องการ

Screenshot: Access policy for Portal SSO Screenshot: Add rule

อัปเดตบริการ Portal

export HALO_DOMAIN=<your-halo-domain>
helm upgrade --install cdrplatform-portal cdrplatform-portal -n cdrplatform --reuse-values \
--set configuration.AutoAdmin=false \
--set configuration.BackendScope="email openid profile" \
--set configuration.BackendUrl="https://${HALO_DOMAIN:?}" \
--set configuration.EnabledPages="SystemSettings\,PolicySettings\,IcapSettings\,IcapRequests\,IcapReporting" \
--set configuration.OIDC.ProviderOptions.Authority="${OKTA_ISSUER_URI:?}" \
--set configuration.OIDC.ProviderOptions.ClientId="${PORTAL_CLIENT_ID:?}" \
--set configuration.OIDC.ProviderOptions.PostLogoutRedirectUri="https://${HALO_DOMAIN:?}/authentication/logout-callback" \
--set configuration.OIDC.ProviderOptions.RedirectUri="https://${HALO_DOMAIN:?}/authentication/login-callback" \
--set appenvironment.HTTP_CSP_CONNECT_SRC="'self' ${OKTA_ORIGIN:?}" \
--set appenvironment.HTTP_CSP_FRAME_SRC="'self' ${OKTA_ORIGIN:?}" \
--set appenvironment.HTTP_CSP_FRAME_ANCESTORS="'self' ${OKTA_ORIGIN:?}" \
--set ingress.enabled=true \
--set ingress.tls.domain="${HALO_DOMAIN:?}" \
--set ingress.tls.enabled=true \
--atomic

อัปเดตบริการ Portal-Access

helm upgrade --install cdrplatform-portal-access -n cdrplatform cdrplatform-portal-access --reuse-values \
--set configuration.Authentication__Schemes__Bearer__Authority="${OKTA_ISSUER_URI:?}" \
--set configuration.Authentication__Schemes__Bearer__ValidAudiences__0="${VALID_AUDIENCE:?}" \
--set configuration.Authentication__Schemes__Bearer__ValidIssuer="${OKTA_ISSUER_URI:?}" \
--set configuration.AuthenticationScheme="Bearer" \
--set configuration.CORSDOMAIN="'*'" \
--set ingress.enabled=true \
--set ingress.tls.domain="${HALO_DOMAIN:?}" \
--set ingress.tls.enabled=true \
--atomic

ให้สิทธิ์การเข้าถึงแก่ผู้ใช้

มี 2 บทบาทใน Halo คือ User และ Admin บทบาทจะถูกกำหนดค่าผ่านการเป็นสมาชิกกลุ่มบนเซิร์ฟเวอร์การให้สิทธิ์ของ Okta (ดู กำหนดบทบาท)

  • หากต้องการให้บทบาทผู้ใช้ ให้เพิ่มผู้ใช้ไปยังกลุ่ม Halo_User
  • หากต้องการให้บทบาทผู้ดูแลระบบ ให้เพิ่มผู้ใช้ไปยังกลุ่ม Halo_Admin