Api google adwords - client_secret for oAuth2.0 - google-oauth

I have a problem with api adwords. I don't have client_secret from code.google.com/apis/console.
I created project and I add API Access for my application but i don't see client_secret in box Service account.
I have Client ID, Email address, Public key fingerprints, private key, and client_secret.json. In api adwords for php is config file auth.ini:
[OAUTH2]
; If you do not have a client ID or secret, please create one of type
; "installed application" in the Google API console:
; https://code.google.com/apis/console#access
client_id = "INSERT_OAUTH2_CLIENT_ID_HERE"
client_secret = "INSERT_OAUTH2_CLIENT_SECRET_HERE"
...
But I don't have client_secret.
What i did wrong? or could give me any suggestions?

The PHP application you are trying to use probably does not work with service accounts.
In order to get a client secret you have to create a client id of type "Web application".

Related

Google Ad API: Linking to manager account, automatic accept of client invitation

I am trying to linking one of the client account to our manager account using Google Ads API.
I followed this link:
https://developers.google.com/google-ads/api/docs/account-management/linking-manager-accounts
I am able to send the invitation to the client but not able to accept the invitation on the behalf of client.
The reason is not able to get manager_link_id. I see the code and that has the following query.
SELECT customer_client_link.manager_link_id FROM " +
"customer_client_link WHERE customer_client_link.resource_name = " +
$"'{customerClientLinkResourceName}'"
The error I get :
User doesn't have permission to access customer. Note: If you're accessing a client customer, the manager's customer id must be set in the 'login-customer-id' header. See https://developers.google.com/google-ads/api/docs/concepts/call-structure#cid
I am using the manager client Oauth. I am not sure we can take it out using that or not.
Please help me how can I solve this issue.
Also is there a way I can get Oauth token for client from my manager account using Ads API.
I used postman to send call the API and it give me below error:
Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

Onelogin API authentication error

I am attempting a very basic call to the one login API to get an authentication token. I copied the client id and client secret correctly from the api credentials page (although the "copy to clipboard button doesn't seem to be working).
r2 = requests.post('https://api.eu.onelogin.com/auth/oauth2/v2/token',
auth=('<CLIENT ID>','<CLIENT SECRET>'),
json={
"grant_type": "client_credentials"
}
)
When I run this, I get an authentication failure error. I have no idea what I am doing wrong, any help would be really appreciated.
The client_id and the client_secret to use in this call actually are not the ones from an app configured in the oneLogin account, you have to set up some API client_id and client_secret in your oneLogin account administration page, give them at least an auth level and then use them in your call to get the tokens
Sure.
Depending on what privileges you need, there are different profiles in the Developers>API credentials section from the Administration portal.You can create a new profile by clicking in the top left blue button named "New credentials".
In your case, I think is enough with a "Authentication only" profile.
Once you have those API credentials, when you are using a BASIC authentication method, you have to set them in the JSON header, but encoded in base64, not just as plain text, and the client_id and client secret are separated by (:) not by (,).
You also need to set up the content type to "application/json" in the header.
Hope this helps.

Firebase token verfification on backend - firebaseID not found in "aud". Google client id is sent instead?

I'm getting this error when using Firebase Admin API to verify user's authentication token obtained from android client from the back-end server -
com.google.firebase.auth.FirebaseAuthException: Firebase ID token has incorrect "aud" (audience) claim. Expected "xxxxx" but got "yyyyy.apps.googleusercontent.com". Make sure the ID token comes from the same Firebase project as the service account used to authenticate this SDK. See https://firebase.google.com/docs/auth/admin/verify-id-tokens for details on how to retrieve an ID token.
I find that that xxxx is the firebase ID and yyyy is the oAuthClient/clientId in the google-services.json of the Android app (client).
Anyone knows the fix (or get around) for this ?
As bojeil commented, I was using Google ID token and not the firebase one.
Appending comment here -
You seem to be verifying a Google ID token and not a Firebase ID token. That is the aud for Google ID tokens. To get the Firebase ID token, you need to call FirebaseUser.getToken()

Unable to use Resource owner credentials of Oauth2 for Rdio

We are using rdio to get music from rdio in our app. We have used OAuth2.0 for authentication. Currently we are using authorization code. I am exploring to switch to Resource owner credentials documented in (http://www.rdio.com/developers/docs/web-service/oauth2/auth-password/ref-oauth2-auth-password ). I have created the app in rdio site, obtained the client_id and client_secret. I am making POST call to https://services.rdio.com/oauth2/token and passing username= password= (HTTP Authorization header method of client verification) . The response comes as "error_code":"unauthorized_client" "error_description": "This client is not authorized to use the password grant". I have tried to substitute username and password with real username and password, but that doesn't work. Is it the validity of client_id and client_secret that is the issue? I've followed all the steps to T. Please let me know what am i doing wrong?
Regards Vinay
This OAuth 2.0 grant isn't available to every one, the documentation says:
This method is limited to trusted Rdio partners. Please contact us if you feel your application needs to use this method.

Validating user's API credentials - PayPal DoDirectPayment

Hello I am working on a site that accept PayPal API Credentials for every restaurant owner so that amount could be transferred to their account directly.
The problem that I am facing, some times restaurant owners add wrong API credentials so when any order is placed the error "Security Header is not valid" appears means their API credentials is wrong.
The solution I want is that the API Credentials could be verified when they are added by restaurant owner, so that order could be placed by end user.
Is there any way to Verify/Validate PayPal API Credentials(User Name, Password, Signature), Please help.
Thanks in advance!
PayPal Don't have any External API to validate the API Credentials alone.
instead. You can Use the Express Checkout SETEXPRESSCHEKOUT API to call with very Minimal data and the API credentials, which will validate the API credentials and will generate a Token. If you get a Token it means the API credentials is correct. This will not do any money Movement with this API Call. PP have this API available in both NVP and SOAP format.