OAuth2 API Error


#1

No matter what I do, when I try to get the OAuth token from IC2, I get this error:

Error: oauth2: cannot fetch token: 401 Unauthorized
Response: {"error":"invalid_client","error_description":"invalid_client"}

With my client id and secret, I get the code fine.

When I use the code to get the token, that is when I get the above error.

I’m in HTTPS. I’ve triple checked everything. I have no clue what could be wrong.


#2

I have fixed this.

For anyone else with this issue, Peplink doesn’t follow strict Oauth2 standards.

I put in a request for golang/oauth2 to add the below token URL to brokenAuthHeaderProviders in token.go

https://api.ic.peplink.com/api/oauth2/token