Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

issue revoking oauth2 token in forge app

I have an application that connects to google and get the profile details, everything works fine with the authorization and getting the profile.

However I want to add the option to revoke access from my application, and currently i don't see this possible programmatically.

google api to revoke token:

curl -d -X -POST --header "Content-type:application/x-www-form-urlencoded" \
        https://oauth2.googleapis.com/revoke?token={token}

I'm using fetch to call the remote:

const google = api.asUser().withProvider('google', 'google-oauth');
const response = await google.fetch('/revoke', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'}});
in this case the token is actually never sent and I always get bad request error.

since bearerMethod type "
form-encoded" and "uri-query" is depreciated there is no way to call the revoke.
does anyone have a solution?

1 answer

0 votes
Dave Rosenlund _Trundl_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 27, 2024

Hi, @Mazen Chmait_FusionTech Innovations_Marketplace Partner  👋

Did you know there's a special/dedicated Atlassian Community for developers like you?

In other words, you may have better luck with this question in The Atlassian Developer Community.

Best,

-dave

Hi @Dave Rosenlund _Trundl_ ,

Thank you for sharing this, I already posted the same question on the developer community.

Regards,

Mazen

Like Dave Rosenlund _Trundl_ likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events