OC-AUTH with admin persona

This commit is contained in:
mr
2024-10-30 16:18:21 +01:00
parent d87883b57f
commit d33d2eb343
15 changed files with 52 additions and 52 deletions

View File

@@ -146,7 +146,6 @@ func (a HydraConnector) Login(username string, cookies ...*http.Cookie) (t *Toke
// problem with consent THERE we need to accept the consent challenge && get the token
_, err = a.Caller.CallRaw(http.MethodGet, a.urlFormat(redirect.RedirectTo, a.getPath(false, true)), "", map[string]interface{}{},
"application/json", true, cookies...)
fmt.Println(err)
if err != nil {
s := strings.Split(err.Error(), "\"")
if len(s) > 1 && strings.Contains(s[1], "access_token") {
@@ -242,15 +241,12 @@ func (a HydraConnector) getPath(isAdmin bool, isOauth bool) string {
if isOauth {
oauth = "/oauth2"
}
fmt.Println("http://" + host + ":" + port + oauth)
return "http://" + host + ":" + port + oauth
}
func (a HydraConnector) CheckAuthForward(reqToken string, publicKey string, host string, method string, forward string) bool {
fmt.Println("CheckAuthForward", reqToken, publicKey, host, method, forward)
if forward == "" || method == "" {
fmt.Println("Forwarded headers are missing")
return false
}
var c claims.Claims

View File

@@ -254,7 +254,6 @@ func (cli *Client) connect(ctx context.Context) <-chan conn {
)
wg.Add(len(cli.Endpoints))
for _, addr := range cli.Endpoints {
fmt.Println("addr", addr)
go func(addr string) {
defer wg.Done()