You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe I have encountered a bug in the OAuth2Api.RevokeOAuth2Token function in the Go SDK. With both the AdminURL and the PublicURL along with client credentials set in the Configuration, the OAuth2Api struct holds the AdminURL as its Configuration.BasePath value, and a call to the RevokeOAuth2Token then triggers a request to the AdminURL + "/oauth2/token" URL, which results in a 404 Not Found error. I have tried manually overriding the localVarPath in the RevokeOAuth2Token method to use the PublicURL as the BasePath and the request then works normally, and the token is revoked successfully.
I think the best way to solve is is what @fredbi set on discord: Introduce "admin" and "public" tags to the swagger conf and thus separating the implementations.
I do not have enough in-depth knowledge in your SDK yet, but I guess I would simply add the PublicPath to the configuration, with a new NewOAuth2Api method that would accept either a whole Configuration instance or both BasePath and PublicPath, and then let each func decide which path to use for the call.
Edit: if this would be acceptable, I can prepare a PR.
I believe I have encountered a bug in the
OAuth2Api.RevokeOAuth2Token
function in the Go SDK. With both theAdminURL
and thePublicURL
along with client credentials set in the Configuration, theOAuth2Api
struct holds theAdminURL
as itsConfiguration.BasePath
value, and a call to theRevokeOAuth2Token
then triggers a request to theAdminURL + "/oauth2/token"
URL, which results in a404 Not Found
error. I have tried manually overriding thelocalVarPath
in theRevokeOAuth2Token
method to use thePublicURL
as theBasePath
and the request then works normally, and the token is revoked successfully.Short example:
Expected behaviour is for the above revoke call to succeed, but the response status code is 404 instead.
Tested in
1.0.0-beta.9
The text was updated successfully, but these errors were encountered: