Portal 介接相關資訊     [ portal v1.7.4 ,   built at: 2024-06-14 08:47 (GMT) ]
項目 說明
如何與 Portal 介接

中央大學 Portal 扮演國立中央大學 Identity Provider 的角色,支援以下數種介接方式供 Service Provider 介接,選擇其中一種即可,(Deprecated 的不建議)。

OpenID Connect
建立在 OAuth 的基礎上,為標準用來認證用的協定,因為系統提供 discovery 機制,支援 discovery 的 Service Provider 只要知道 portal.ncu.edu.tw 就可以連線。但因為我們沒有提供登入者的其它額外資訊,若需要這些資訊,可以考慮使用 OAuth。
OAuth
RFC 6749 The OAuth 2.0 Authorization Framework 的標準,支援 Authorization Code 的 flow。特色是可以藉由使用者授權得到登入者的個人資訊。
SAML
Security Assertion Markup Language 的簡稱,Language 的 spec 本身很複雜,認證 flow 很簡單。
SimpleAuth
Proprietary protocol, 簡化版的 OAuth,認證只能由 Portal 出發,省掉 Authorization Code flow 的第一個動作。當同樣由 Portal 出發做登入時,比 OAuth 少了一次的彈出一次的彈回。
OpenID
Deprecated (相容保留),第二代的 Portal 導入 (註: 自第二代起,Portal 採用自行開發及維護)。因 OpenID 已改向較安全的 OpenID Connect,因此我們提供 OpenID Connect 來取代 OpenID。
Webcomm
Deprecated, proprietary protocol, 第一代 IBM WebSphere Portal 使用。
OpenID Connect
  • 支援 OpenID Connect Discovery 1.0,透過網址 https://portal.ncu.edu.tw/.well-known/openid-configuration 取得連線相關資訊。
  • OpenID Connect 單一簽入入口: https://portal.ncu.edu.tw/openid/authorization
  • OpenID Connect 取得 Access Token 入口: https://portal.ncu.edu.tw/openid/token 支援 client_secret_post 或 client_secret_basic。
  • OpenID Connect 使用者資訊入口: https://portal.ncu.edu.tw/openid/user
SAML
  • SAML Meta Data: https://portal.ncu.edu.tw/saml/metadata
  • SAML 單一簽入入口: https://portal.ncu.edu.tw/saml/sso
  • 使用 SAML 介接並希望提供登入者帳號以外的用戶資訊,請洽電算中心管理人員。
OAuth
  • OAuth 單一簽入入口: https://portal.ncu.edu.tw/oauth2/authorization (採用 GET Method)
  • OAuth 取得 Access Token 入口: https://portal.ncu.edu.tw/oauth2/token (採用 POST Method, 需要以 Client Id/Client Secret 做為 Basic Auth 的帳號密碼, 另外在 request header 上要 Accept: application/json)
  • 使用者資訊入口: https://portal.ncu.edu.tw/apis/oauth/v1/info (採用 Get Method, 傳回 JSON 格式的使用者資訊)
取得代碼對照表
  • https://portal.ncu.edu.tw/apis/ncu/studySystems
  • https://portal.ncu.edu.tw/apis/ncu/academicsUnits
  • https://portal.ncu.edu.tw/apis/ncu/units
  • https://portal.ncu.edu.tw/apis/ncu/titles
  • https://portal.ncu.edu.tw/apis/ncu/emTypes
  • https://portal.ncu.edu.tw/apis/ncu/esTypes
  • https://portal.ncu.edu.tw/apis/ncu/studentStatus
  • 註:以 client id / client secret 為帳號密碼,BasicAuth 認證方式。
OAuth Scopes
  • id : 使用者的 id,一個 64 位元的長整數,跨系統時,id 是不同的。(一定有的資訊,系統可以不要求使用者帳號資訊做為無記名的系統)
  • identifier : 使用者的帳號。當應用系統在 Portal 上記錄需要 identifier 時,使用者只能選擇不登入,但不能拒絕授權。
  • chinese-name : 中文姓名 (使用者可以決定是否授權)
  • english-name : 英文姓名 (使用者可以決定是否授權)
  • gender : 姓別 (使用者可以決定是否授權)
  • birthday : 出生日期 (使用者可以決定是否授權)
  • personal-id : 身分證字號/居留證號 (使用者可以決定是否授權)
  • student-id : 學號 (學生才有, 使用者可以決定是否授權)
  • academy-records : 學籍資料 (學生才有, 使用者可以決定是否授權)
  • faculty-records : 教職員資料 (教職員才有, 使用者可.以決定是否授權)
  • email : 電子郵件信箱 (使用者有在系統上登記才有, 使用者可以決定是否授權)
  • mobile-phone : 行動電話號碼 (使用者有在系統上登記才有, 使用者可以決定是否授權)
OAuth 授權資料
    class OAuthAuthorizedData {
        class AcademyRecords {
            string name
            string studySystemNo
            string degreeKindNo
            string didGroup
            string grad
            string studentStatus
        }
    
        class AlumnusRecords {
            string name
            string studySystemNo
            string degreeKindNo
            string didGroup
            string leaveSemester
            string leaveYear
            string gradYear
            string iYear
            string iSemester
            string iReason
        }
    
        class FacultyRecords {
            string unit
            string unitNo
            string tunitNo
            string occupation
            string emTypeNo
            string esTypeNo
        }
    
        class Delegator {
            string identifier
            string chineseName
            int delegateId
        }
    
        long id
        string identifier
        string chineseName
        string englishName
        string gender
        string birthday
        string personalId
        string studentId
        string email
        boolean emailVerified
        string mobilePhone
        boolean mobilePhoneVerified
        AcademyRecords academyRecords
        FacultyRecords facultyRecords
        AlumnusRecords alumnusRecords
        Delegator delegator
    }
                            
文件及範例