How to use CDAP http plugin to get google cloud api with OAUTH 2.0? - google-oauth

I want to get BigQuery schema form Google Cloud API, I config all the things in GCP,and I can get info from the postman, but how to config in CDAP, here is my config:
And my CDAP version is 6.2.0

You can read about the oAuth documentation from https://developers.google.com/identity/protocols/oauth2/web-server
And for the scope of the oAuth for BigQuery, you can refer to the following documentation:
https://developers.google.com/identity/protocols/oauth2/scopes#bigquery

Related

Error in IBM Cloud API PCloudInstances request

I am trying to make this request from IBM Cloud API: Documentation
I have successfully made other requests like pvmInstances and Volumes, so we should have the permission, but this one returns this error: {'description': 'Your access token is invalid or does not have the necessary '
'permissions to perform this task.',
'error': 'Access Denied'}.
Is there anyone who can help me please?
Verify that you can perform the actions in the IBM Cloud Console UI. If that works OK, then login using the CLI and get the tokens as described in the docs to use curl

Getting "PARTNER_AUTHENTICATION_FAILED" error

While configuring API in Unqork(No-Code platform) getting error "PARTNER_AUTHENTICATION_FAILED" while try to fetch Signed Document.
I have used this API Endpoint - {{baseUrl}}/v2.1/accounts/{{accountId}}/envelopes/{{envelopeId}}/documents/0
And also getting file in UTF-8 format. But when trying to convert it into PDF than getting blank document.
Unqork
From google searching, it looks like this page may be of help: https://academy.unqork.com/advanced-api-authentication
In general, you need to get unqork to use OAuth with a DocuSign oauth service provider (account-d.docusign.com) to obtain an access token. Then use that access token in unqork's API calls to DocuSign.
Contact unqork's customer service group for more help.
General information on the problem
PARTNER_AUTHENTICATION_FAILED more information error message
Are you using legacy authentication or OAuth authentication? Only OAuth is supported for new integrations.
You must obtain an access token to make API calls. You can obtain an access token via OAuth.
See the docs. Or a video.
If you want more help, ask a new question and provide more information on exactly what you have tried and what is or is not working.

Invoking wso2greg Artifcat Rest API via wso2api manager is not working - any ideas to fix

UPDATED QUESTION to clarify more.
I have two servers : wso2greg containing custom artefacts and wso2am (api manager).
The gouvernance register is intended to be used internally (intranet) and some of it's feature are intended to be exposed externally and acceded via it's rest API.
In order to manage wso2greg API accesss, we used an wso2am (api manager) server, where we did define an API that act as a proxy for the wso2greg API.
In our experiments, we found the strange behaviour described below :
Successfully direct calling wso2greg artefact rest api (the exact url is
https://localhost:9443/resource/1.0.0/artifact/_system/governance/myartifact/art1 and i'm following the documentation of this REST API from here https://docs.wso2.com/display/Governance520/Resources+with+REST+API ) using postman. The API reacts as described in the documentation.
Error 500, reported on wso2greg server, when calling the same REST API, but via API manager (using publisher application).
So as a summary :
Directly calling wso2greg rest API woks fine and a got results back
Adding this working API, in wso2am and than calling it gives always error 500.
As extra information:
Tested with other wso2greg REST API , such as "rating" or "comments" and I was able to call it successfully either directly or throw Api manager.
Tried to get information related to default wso2greg artifacts such as restservice, but i got exactly the same pb when (error 500) interagting with API manager.
Working with the last version of both products : wso2greg version 5.2.0 and wso2am version 1.10.0
Please advice, or clarify how could i debug this internal error in wso2greg.
Regards,
I hope your not using G-Reg + APIM feature installed version. I presume your using separate G-reg 5.2.0 and APIM x.x.x. Since your using the second option you can't use G-Reg REST API with APIM, therefore you have to use APIM REST API instead.
Get an API
Description: Get details of a specific API.
URI: http://localhost:9763/publisher/site/blocks/listing/ajax/item-list.jag
URI Parameters: action=getAPI&name=xxx&version=xxx&provider=xxx
HTTP Methods: POST
Example:
curl -X POST -b cookies http://localhost:9763/publisher/site/blocks/listing/ajax/item-list.jag -d "action=getAPI&name=PhoneVerification&version=1.0.0&provider=admin"
Please follow this link to see all the api usage.
Thanks #thusharaK for providing help.
The solution was to add Message Mediation Policies which forces json header on output.
Now i got my correct response from API manager (in fact, i got a binary response in test console and a json response in postman) .

How to obtain a LinkedIn token via Titanium

I want to log in to my application via LinkedIn. This can be done via a call to Cloud.SocialIntegrations.externalAccountLogin() .
However, the function above needs a 'token' parameter. The 'token' is provided by LinkedIn by following the oauth flow(retrieve an authorization code, exchange of the Authorization Code for a Request Token).
Is there an easy way in titanium to obtain this token? I have investigated aaronksaunders's(https://github.com/aaronksaunders/clearlyinnovative.linkedIn) code, and searched on gitt.io. Or do we need to write all of this boilerplate code ourselves?
NOTE: At the moment, I don't want to proxy the call via a server(I prefer not to set up an SSL certificate, etc) and I don't have an appcelerator team or enterprise plan, so I can't use their node(arrow) backend to proxy these calls.
Additional question: is it sufficient to configure the iOS Bundle Identifiers(on the LinkedIn app settings page)? And do I need to use this 'iOS settings' application Id(also on the LinkedIn app settings page)?
I have successfully finished my flow. Everything is explained in this blog post from Ramkumar M: http://shareourideas.com/2012/12/18/linkedin-connect-for-appcelerator-titanium/. The result is achieved by using a modified commonjs module version of the social.js library: https://gist.github.com/rampicos/4320296
This library has a very clean api, the whole flow is nothing more than:
var social = require('social');
var linkedin = social.create({
consumerSecret : CONSUMER_SECRET,
consumerKey : CONSUMER_KEY,
site: 'linkedin'
});
linkedin.authorize(function(){
//callback
});
I don't use the
Cloud.SocialIntegrations.externalAccountLogin()
because the login is done by the social.js library.
LinkedIn app: I have only configured the iOS bundle identifiers.

Socialauth API 4.3 with Google Oauth 2.0

Does anyone know how to use Brickred Socialauth API 4.3 in servlets with Google Oauth 2.0?
Where could I get the *consumer_secret* and *consumer_key*?
Was using the API successful at your side?
The instructions available on the BrickRed wiki no longer work as you have already found out. The following should work assuming:
A. You are using socialauth 4.2+. I tested these with socialauth 4.4.
B. You are trying to configure your own domain and not using the brickred domain for testing.
C. You are creating a web application, else adjust accordingly
First register your application on Google Cloud console:
a. Go to https://cloud.google.com/console/project
b. Login
c. Create a new project
d. APIs & Auth > Credentials
e. Create New Client ID ( Application Type: Web Application, Authorized redirect URL: http://YOUR_HOST_NAME/socialauth.html)
Modify brickred properties.xml
Replace
<prop key="www.google.com.consumer_key">opensource.brickred.com</prop>
<prop key="www.google.com.consumer_secret">YC06FqhmCLWvtBg/O4W/aJfj</prop>
with
<prop key="googleapis.com.consumer_key">CLIENT ID created in Step 1.e above</prop>
<prop key="googleapis.com.consumer_secret">Client Secret created in Step 1.e above </prop>
If you are not using Spring, modify oauth_consumer.properties
Modify the link in your application where the user clicks on to start the contacts import process:
change
?id=google
to
?id=googleplus
Hope this helps
You can register your app to use Google OAuth at:
https://developers.google.com/accounts/docs/OAuth2Login#registeringyourapp
from where you get your "secret / key".
I have successfully implemented SocialAuth with Facebook and it worked properly. I still don't have any experience implementing it with google OAuth2 but it should work. Their CDI example does authenticate with Google, I am just not sure if using Oauth1 or Oauth2.
Regards.
For people who cannot find the consumer_secret, I found a solution:
socialauth is using web flow. So if you are socialauth-android you need to create web application instead of installed application.
So even for an Android App, you still need create a Client ID for web project. The secret will be displayed in page directly!