Bitbucket - Revoke Oauth Authorization API - bitbucket

In bitbucket, i have created oauth consumer & implemented authentication flow (Authorization Code Grant) https://developer.atlassian.com/cloud/bitbucket/rest/intro/#1--authorization-code-grant--4-1-
Need help with revoke authorization api
After some point of time, if user wants to revoke this authorization it can be achieved in bitbucket website (attached img reference)
revoke authorizarion from website
I couldn't find the rest api reference to revoke app authorization from my website itself. Kindly assist me on how to revoke the authorization

Related

Does Oauth Authorization Code flow generates a service principal sign in event?

in Oauth Client credentials flow, when application gets an access token after authenticating using the credentials There will be a Service Principal SignIn event.
I wanted to know whether there will be a SPN SignIn event for Oauth authorization code flow as well. Here the client id, auth code and client secret (incase of web app) is sent to Oauth token endpoint to get a access token. But I'm not sure if it will generate a SPN Sign In event.
No, when you use authorization code flow, it will not generate a SPN Sign In event.
It will generate a new record(under "Service Principal sign-ins" tab) when you use client credentials flow, because client credential uses a service principal to do authentication (shown as below screenshot).
But when you use authorization code flow, it will generate a record under "User sign-ins (interactive)" tab like below screenshot. Because authorization code flow uses user account to do authentication but not service principal.

OAuth2.0 [PKCE] Flow failing between LinkedIn and Forgerock

Implementation-
Enable OAuth2.0 flow between LinkedIn & Forgerock AM where FR AM acts as a client and LinkedIn is the OAuth provider.
Problem-
We are integrating "LinkedIn Sign" into one of our apps using OAuth2.0 with Forgerock AM as a client. Right now, Forgerock, which is acting as a client, passes PKCE parameters in the authorization request endpoint to LinkedIn (code challenge & code challenge method) and we receive the authorization code along with the state parameter. But subsequent request to retrieve access token fails with PKCE error.
Key info from the logs-
"ERROR: Exception in processing the tree
org.forgerock.openam.auth.node.api.NodeProcessException: Unable to get UserInfo details from provider
at org.forgerock.openam.auth.nodes.oauth.AbstractSocialAuthLoginNode.getUserInfo(AbstractSocialAuthLoginNode.java:338)
Caused by: org.forgerock.oauth.OAuthException: Unable to process request. {"error":"access_denied","error_description":"Not enough permissions to access Native PKCE protocol"}
at org.forgerock.oauth.clients.oauth2.OAuth2Client.lambda$mapToJsonValue$0(OAuth2Client.java:126)
at org.forgerock.util.CloseSilentlyFunction.apply(CloseSilentlyFunction.java:53)
at org.forgerock.util.CloseSilentlyFunction.apply(CloseSilentlyFunction.java:29)
at org.forgerock.util.promise.PromiseImpl.lambda$then$6(PromiseImpl.java:374)
at org.forgerock.util.promise.PromiseImpl.handleCompletion(PromiseImpl.java:536)
at org.forgerock.util.promise.PromiseImpl.setState(PromiseImpl.java:577)
at org.forgerock.util.promise.PromiseImpl.tryHandleResult(PromiseImpl.java:258)
at org.forgerock.util.promise.PromiseImpl.handleResult(PromiseImpl.java:208)
at org.forgerock.util.promise.PromiseImpl.lambda$then$6(PromiseImpl.java:374)"
LinkedIn API reference & OAuth2.0 -
https://learn.microsoft.com/en-us/linkedin/shared/authentication/authorization-code-flow?context=linkedin/consumer/context
P.S. Forgerock AM when integrated with Google using OAuth2.0 [PKCE] is working absolutely fine.
Any help will be much appreciated.
Thank you.
As per microsoft doc: https://learn.microsoft.com/en-us/linkedin/shared/authentication/authorization-code-flow-native you need to contact linkedin team to enable PKCE for you and then the authorization URL for PKCE is different as well - https://www.linkedin.com/oauth/native-pkce/authorization

How to sign up user to AWSCognitoIdentityUserPool and get the JWT tokens back?

How to sign up a user to AWSCognitoIdentityUserPool and get the JWT tokens back?
I got Facebook token from facebook registration. Then how can I register user in the User pool with based on that token?
I need to get JWT tokens in responce after that to use them in my own backend.
Struggling with it a week already..
Recognize authentication is a two step process. First, your app must authenticate with Facebook to receive a JWT, it seems that you have done this successfully. Second, this JWT is exchanged for IAM credentials that will be used for API calls.
Authentication Flow:
App authenticates with Identity provider using the SDK for that identity provider. In response, the Identity provider sends a JWT that will be cached by the app.
App uses cached JWT to authenticate with AWS. If the Identity provider is configured in AWS, in response, AWS sends IAM credentials with the permissions granted to that identity provider.
IAM credentials are used to make calls to other AWS resources specified in the Policy
This documentation goes into more detail for these steps in regarding Facebook.
The AWS Amplify Library has support for iOS. I would recommend using this library to handle Authentication against Facebook Federated Identities.
You do not necessarily need a user pool managed in Cognito, as the user pool function is managed by Facebook.

failing to receive onedrive oauth refresh_token when authenticating through SSO

I have an app that supports saml based sso and oauth based access to cloud storage providers such as google drive, dropbox, and microsoft onedrive. I have an account setup that uses OneLogin as an identity provider, and my app and onedrive acting as service providers. the app requires users to authenticate with their cloud storage provider, so I redirect the user from the app to onedrive during this auth step. since they are using onelogin sso, they are redirected from onedrive to onelogin, they login to onelogin, and are redirected back to onedrive. Here they resume the oauth flow and agree to grant the app certain permissions and send back a code. I use this code to ping onedrive's /token route to exchange it for an access_token and a refresh_token. however we are not receiving the refresh_token, thus requiring the user to frequently have to reauthenticate with onedrive.
does anyone have any insight as to why we are not receiving a refresh_token? I have reached out to onelogin and microsoft as well (no progress/response yet).
I have toyed around with settings in MS azure and onelogin but haven't solved the issue yet.
other details:
in microsoft azure, users are federated using ws-federation
so far, this issue only occurs with users who are using onedrive and an sso provider
i am using the v1 onedrive api
the auth response includes the access_token and other properties, just not the refresh_token
here is a link detailing the oauth flow for onedrive, indicating that i can expect a refresh_token from the https://login.microsoftonline.com/common/oauth2/token route: https://learn.microsoft.com/en-us/onedrive/developer/rest-api/getting-started/aad-oauth (in fact this refresh_token is necessary to finish the flow)
here is another SO post that seems to be having a similar issue, but with godaddy: Refresh token not returned for Office365 accounts purchased through GoDaddy (i have tried messing with the StsRefreshTokensValidFrom attribute but to no avail)
to be clear, the flow is:
from app, attempt to oauth auth with onedrive
get redirected to onelogin
login to onelogin
get redirected to onedrive
grant permission for 3rd party app access
get redirected back to app with access code
exchange code for oauth tokens
fail to receive refresh_token
thanks!
To get a refresh_token, you need to set up the Refresh Token (timeout) field in the Token Timeout Settings of the SSO tab in the Application configured in your OneLogin Administration portal.

Live.com OAuth revoke access

What is the url or request for revoking access token in live.com OAuth?
The similar request on Google Oauth is:
POST https://accounts.google.com/o/oauth2/revoke?token=%access_or_refresh_token%
From this link: http://msdn.microsoft.com/en-us/library/ff752110.aspx, it appears that revoking consent is a manual process and even then, it does not immediately revoke a token.

Resources