The API docs mention that the correct url to authenticate is https://<subdomain>.onelogin.com/auth/oauth2/v2/token. This is easy to confirm by sending a request to it.
Hence, every request fails without much to do about it.
The subdomain URL should also be used for authentication (both generating & revoking tokens). It is generated one line before invoking the GenerateToken() method in NewClient(), so it can be passed in as a parameter.
The API docs mention that the correct url to authenticate is
https://<subdomain>.onelogin.com/auth/oauth2/v2/token
. This is easy to confirm by sending a request to it.The SDK constructs this subdomain URL correctly when creating a client: https://github.com/onelogin/onelogin-go-sdk/blob/130b44035acebcfd3b2ee1ad3ef081914376791d/pkg/onelogin/api/client.go#L39-L40
However, the
Authenticator
completely ignores this and hardcodes the URL without region in the subdomain: https://github.com/onelogin/onelogin-go-sdk/blob/130b44035acebcfd3b2ee1ad3ef081914376791d/pkg/onelogin/authentication/authenticator.go#L40-L41Hence, every request fails without much to do about it.
The subdomain URL should also be used for authentication (both generating & revoking tokens). It is generated one line before invoking the
GenerateToken()
method inNewClient()
, so it can be passed in as a parameter.