This commit is contained in:
simonzhangsz committed 2023-08-24 10:00:27 +08:00
1 parent 254bf9dbdb
commit a715828a2a
8 files changed
+130 -115

No files matched your search

+5 -5
View File
@@ -14,11 +14,11 @@ import (
)
var (
UriOauthToken = config.DefaultUriPrefix + "/securityManagement/{apiVersion}/oauth/token"
UriOauthHandshake = config.DefaultUriPrefix + "/securityManagement/{apiVersion}/oauth/handshake"
UriOauthToken = config.DefaultUriPrefix + "/securityManagement/{apiVersion}/{elementTypeValue}/token"
UriOauthHandshake = config.DefaultUriPrefix + "/securityManagement/{apiVersion}/{elementTypeValue}/handshake"
CustomUriOauthToken = config.UriPrefix + "/securityManagement/{apiVersion}/oauth/token"
CustomUriOauthHandshake = config.UriPrefix + "/securityManagement/{apiVersion}/oauth/handshake"
CustomUriOauthToken = config.UriPrefix + "/securityManagement/{apiVersion}/{elementTypeValue}/token"
CustomUriOauthHandshake = config.UriPrefix + "/securityManagement/{apiVersion}/{elementTypeValue}/handshake"
)
func LoginFromOMC(w http.ResponseWriter, r *http.Request) {
@@ -87,7 +87,7 @@ func LoginFromOMC(w http.ResponseWriter, r *http.Request) {
return
}
token := oauth.GenRandToken() // Generate new token to session ID
token := oauth.GenRandToken("omc") // Generate new token to session ID
sourceAddr := r.RemoteAddr
affected, err := dborm.XormInsertSession(oAuthBody.UserName, sourceAddr, token,
config.GetExpiresFromConfig(), config.GetYamlConfig().Auth.Session)