repositorypackage
1.1.0
Repository: https://github.com/mobilusoss/go-mobilus-sso.git
Documentation: pkg.go.dev
# README
go-mobilus-sso
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",
PermissionDisplayName: "管理者",
})
if err != nil {
panic(err)
}
// token: D97xRIS9a47POjX6R8pkjwyssFM2IF6IG2q_zSmRxIMsZoFJGzOCMzeK1Rriwr5e2LBp6g-qA-59HSyMwhfm9ACjoE16XQF0tU6U0IziX-QrE2u1vVVDh05ecUPZ-KSvMQIn6nXr1mSQBCbDfATosl6jL9wUgMjCsbu0qABI9e0SPmb5R2J_L9vDuxp-weCpQXKKEk2N2gFn70GsbxEXOybJ1qbhocSH6m4ZJid3ZGwyStIp-kyMvd6z5P0DfYJyy0gkJ4xggqHUXk-W9mE4_qHzONRSPojKqqIBo1TgLIk
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
// user.PermissionDisplayName