Skip to content

Latest commit

 

History

History
44 lines (36 loc) · 1.16 KB

README.md

File metadata and controls

44 lines (36 loc) · 1.16 KB

go-mobilus-sso

Build Status codecov

mobiSeries SSOを行うライブラリーです

Marshal

sso := go_mobilus_sso.New(secret)
token, err := sso.Marshal(go_mobilus_sso.User{
    Name:        "テストマン",
    PermitLevel: 0,
    Token:       "thisistesttoken",
    DomainID:    "adm",
    PlusID:      "[email protected]",
    UserID:      "[email protected]",
    TenantID:    "mobilus",
})
if err != nil {
    panic(err)
}

// token: D97xRIS9a47POjX6R8pkjwyssFM2IF6IG2q_zSmRxINGtSmOweiy7NifAxi3b4Efk1TSh7yP6_dfQ6Exc_Twe1VhUv5B8gUs2KWA3eoNsV3nKMhdjj4gNYMwTgoXR1zbvFdnlgwoMJdJaLr93Fr-u1MZD6rKn31ZmswjWzyN76awGIiKORAL8x0Uc1NkJXDce7xsDEFgYHpWO1yj_8Z5QQ

Unmarshal

sso := go_mobilus_sso.New(secret)
user, err := sso.Unmarshal(cookie)
if err != nil {
    panic(err)
}

// user.Name
// user.PermitLevel
// user.Token
// user.DomainID
// user.PlusID
// user.UserID
// user.TenantID