OC-AUTH with admin persona
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user