Add getting int clientids

This commit is contained in:
kolaente 2020-11-16 20:38:08 +01:00
parent 710f23c754
commit aabb7158ed
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 8 additions and 1 deletions

View File

@ -24,6 +24,7 @@ import (
"math/rand"
"net/http"
"regexp"
"strconv"
"strings"
"time"
@ -91,10 +92,16 @@ func getProviderFromMap(pi map[interface{}]interface{}) (*Provider, error) {
Name: pi["name"].(string),
Key: k,
AuthURL: pi["authurl"].(string),
ClientID: pi["clientid"].(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
provider.OpenIDProvider, err = oidc.NewProvider(context.Background(), provider.AuthURL)
if err != nil {