How to revoke access token from Dropbox - dropbox-api

Is there any way how to revoke an access token using Dropbox API (either HTTP or JAVA lib)? The same functionality as https://accounts.google.com/o/oauth2/revoke for Google.

See https://www.dropbox.com/developers-v1/core/docs#disable-token. (You need to use API v1. I don't believe there's yet an equivalent in API v2.)

There are different endpoints for different versions of the Dropbox API:
V2
HTTP reference:
https://www.dropbox.com/developers/documentation/http/documentation#auth-token-revoke
V1:
HTTP reference: https://www.dropbox.com/developers-v1/core/docs#disable-token
Java reference: http://dropbox.github.io/dropbox-sdk-java/api-docs/v1.8.x/com/dropbox/core/DbxClient.html#disableAccessToken()

Related

How to configure google identity platform with CLI sdk?

I am trying to change google identity platform configuration with cli using gcloud CLI SDK for linux.
to be specific I want to call these API getConfig and UpdateConfig
Is there a way to do this using gcloud cli? there seems to be a group called Identity as per the docs, but this does not seem to be doing what I want
I struggled using Google's Identity Toolkit/Platform and how these correspond with Firebase-Auth too.
The term is overloaded by Google and Cloud Identity, Identity Platform and Firebase Auth have overlapping sets of functionality.
Name
URL
Cloud Identity API
cloudidentity.googleapis.com
Identity Toolkit API
identitytoolkit.googleapis.com
NOTE Identity Toolkit is inaccessible through Google APIs Explorer
I wanted to be able to programmatically update Firebase Auth's authorized domains.
By observing the calls made by Firebase Console, I needed to use getConfig and updateConfig too.
These aren't surfaced through gcloud.
Essentially:
GET the response from getConfig
I used jq to transform it into my desired state
PATCH config1 using an updateMask
1 The endpoint for the updateConfig method is actually (just) config
This worked for me and hopefully helps you better understand how you can use these methods directly.
I blogged about it more comprehensively here

Can't see Dialogflow access tokens

I'm not using the enterprise edition Dialogflow but I still can't see the developer and client access tokens.
I'm creating my own custom integration and I have been using the client access token that I could see in the General settings. Now both the client and developer access tokens aren't there.
Dialogflow v2 no longer uses developer/client access tokens. Those were for v1 only.
You need to setup authentication and download private keys now to access the API endpoints.

How to use Swift REST API with Bluemix Object Store?

I want to write a Java program running externally to Bluemix that interacts with the instance of the Bluemix Object Store I have provisioned.
The program will use the Swift REST APIs to interact with the service.
The documentation for how to use the REST API is mainly missing in the service documentation and the OpenStack documentation is not helpful with specifics on how to reach the Bluemix service.
Can someone tell me what headers to set and what URL to use to authenticate with the service, and then what headers to set and what URL to use to further interact with the service ? Where do I find this information for my instance of the service ? It doesn't seem to all be available in the service credentials that are displayed.
Also, do I need to do basic authentication every time a REST call is made, or is there a way to get a token ? Where is that explained ?
The Bluemix Object Storage uses the OpenStack Identity (Keystone) v3 API for authentication. For complete documentation on the REST API, see: http://developer.openstack.org/api-ref-identity-v3.html
Since your application will be developed in Java, I'd suggest you use the openstack4j SDK. For example of using openstack4j with Bluemix object storage service, see: https://developer.ibm.com/recipes/tutorials/connecting-to-ibm-object-storage-for-bluemix-with-java/

What is the better way of authentication for REST API in Azure

Wanted to make rest calls, i found there are two ways of authentication.
Method 1. Upload a self-signed ssl certificate and authenticate through certificate and subscription id.
Method 2. Use access token (Bearer ey...) which is obtained from making oauth2 call.
Which method is best way to do?
You should go with Method 2 for many reasons:
Method 1 is the old way and will only work with authenticating Service Management API requests where as Method 2 is the new way and will work with authenticating both Service Management API and Azure Resource Manager API requests.
Azure is moving away from Service Management API and is moving towards Resource Manager API which only supports Method 2. In fact, wherever possible use Resource Manager API instead of Service Management API. Only use Service Management API when there's no Resource Manager API equivalent.

OneDrive REST API

Please let me know what is the authentication method we should use when working with OneDrive REST APIs.
Is it AZURE AD using the URL https://login.windows.net/common/oauth2/authorize?
Or the https://login.live.com/oauth20_authorize.srf?
I'm trying to make a simple call to the new OneDrive REST API (I'm using Azure AD, but not sure if this is the correct Authentication method).
I'm using Postman rest client to send the request.
I have registered my application in Azure AD and given it full permissions to 'Office 365 SharePoint Online'.
I can successfully get an authorization token using the clientId generated in Azure AD.
However when I attempt to list files using following request using the access token I get the following error.
Could you please let me know what could be the issue?
RESOURCE HTTP GET:
URL: https://-my.sharepoint.com/personal//_api/Files
HEADER: Authorization: Bearer
Response:
3001000;reason="There has been an error authenticating the request.";category="invalid_client"
IF you refer the public free version of OneDrive, then you should take a look at OneDrives API Documentation. Which uses Live SDK.
If you are using the OneDrive for Business, then you should use the SharePoint 2013 APIs. For SharePoint online this Question (its answer) on SharePoint StackExchange might be helpful. OR if you look for the new-and-in-preview Office365, you might find this page interesting.
A blog post with full walkthrough and code how to authenticate to SharePoint Online with Azure ACS.
Check out the [new][1] v1.0 O365 APIs that describe the OneDrive Business and other O365 service APIs, including authentication.