Add Okta IdP (#859)

This commit is contained in:
Bethuel
2023-05-29 15:52:04 +03:00
committed by GitHub
parent 49c71b9b9d
commit 2eb9a97fee
6 changed files with 513 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ package idp
import (
"encoding/json"
"math/rand"
"net/url"
"strings"
)
@@ -57,3 +58,14 @@ func GeneratePassword(passwordLength, minSpecialChar, minNum, minUpperCase int)
})
return string(inRune)
}
// baseURL returns the base url by concatenating
// the scheme and host components of the parsed URL.
func baseURL(rawURL string) string {
parsedURL, err := url.Parse(rawURL)
if err != nil {
return ""
}
return parsedURL.Scheme + "://" + parsedURL.Host
}