Documentation ¶
Index ¶
- func CreateAccessToken(config SSOConfig, ssoResponse ServiceResponse) (token string, err error)
- func CreateRefreshToken(config SSOConfig, ssoResponse ServiceResponse) (token string, err error)
- func LoginCreator(config SSOConfig, errorLogger *log.Logger) func(w http.ResponseWriter, r *http.Request)
- func MakeAccessTokenMiddleware(config SSOConfig, key string) func(nextHandler http.Handler) http.Handler
- func MakeRefreshTokenMiddleware(config SSOConfig) http.Handler
- func ReadOrgcode() (data map[string]Jurusan)
- func TemplateRenderHandler(data interface{}, config SSOConfig, w http.ResponseWriter) (err error)
- func ValidatTicket(config SSOConfig, ticket string) (bodyBytes []byte, err error)
- type Attributes
- type AuthenticationSuccess
- type DataRender
- type Jurusan
- type LoginResponse
- type SSOConfig
- type SSOJwtClaim
- type ServiceResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAccessToken ¶
func CreateAccessToken(config SSOConfig, ssoResponse ServiceResponse) (token string, err error)
func CreateRefreshToken ¶
func CreateRefreshToken(config SSOConfig, ssoResponse ServiceResponse) (token string, err error)
func LoginCreator ¶
func ReadOrgcode ¶
func TemplateRenderHandler ¶
func TemplateRenderHandler(data interface{}, config SSOConfig, w http.ResponseWriter) (err error)
Types ¶
type Attributes ¶
type Attributes struct { XMLName xml.Name `xml:"attributes" json:"-"` Ldap_cn string `xml:"ldap_cn" xml:"ldap_cn"` Kd_org string `xml:"kd_org" json:"kd_org"` Peran_user string `xml:"peran_user" json:"peran_user"` Nama string `xml:"nama" json:"nama"` Npm string `xml:"npm" json:"npm"` Jurusan Jurusan `json:"jurusan"` }
type AuthenticationSuccess ¶
type AuthenticationSuccess struct { XMLName xml.Name `xml:"authenticationSuccess" json:"-"` User string `xml:"user" json:"user"` Attributes Attributes `xml:"attributes" json:"attributes"` }
type DataRender ¶
func MakeTemplate ¶
func MakeTemplate(config SSOConfig, res interface{}) (tmpl *template.Template, dataRender DataRender, err error)
type LoginResponse ¶
type LoginResponse struct { AccessToken string `json:"access_token"` RefreshToken string `json:"refresh_token"` Nama string `json:"nama,omitempty"` Npm string `json:"npm,omitempty"` Fakultas *Jurusan `json:"fakultas,omitempty"` }
func LoginRequestHandler ¶
func LoginRequestHandler(ticket string, config SSOConfig) (res LoginResponse, err error)
func MakeLoginResponse ¶
func MakeLoginResponse(config SSOConfig, model ServiceResponse) (res LoginResponse, err error)
type SSOConfig ¶
type SSOJwtClaim ¶
type ServiceResponse ¶
type ServiceResponse struct { XMLName xml.Name `xml:"serviceResponse" json:"-"` AuthenticationSuccess AuthenticationSuccess `xml:"authenticationSuccess"` }
func Unmarshal ¶
func Unmarshal(bodyBytes []byte) (model ServiceResponse, err error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.