Add getting int clientids
This commit is contained in:
parent
710f23c754
commit
aabb7158ed
|
@ -24,6 +24,7 @@ import (
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"net/http"
|
"net/http"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -91,10 +92,16 @@ func getProviderFromMap(pi map[interface{}]interface{}) (*Provider, error) {
|
||||||
Name: pi["name"].(string),
|
Name: pi["name"].(string),
|
||||||
Key: k,
|
Key: k,
|
||||||
AuthURL: pi["authurl"].(string),
|
AuthURL: pi["authurl"].(string),
|
||||||
ClientID: pi["clientid"].(string),
|
|
||||||
ClientSecret: pi["clientsecret"].(string),
|
ClientSecret: pi["clientsecret"].(string),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cl, is := pi["clientid"].(int)
|
||||||
|
if is {
|
||||||
|
provider.ClientID = strconv.Itoa(cl)
|
||||||
|
} else {
|
||||||
|
provider.ClientID = pi["clientid"].(string)
|
||||||
|
}
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
provider.OpenIDProvider, err = oidc.NewProvider(context.Background(), provider.AuthURL)
|
provider.OpenIDProvider, err = oidc.NewProvider(context.Background(), provider.AuthURL)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user