Google Autocomplete Places API sessiontoken parameter - google-maps-api-3

I am lost with the session token parameter in the webservice api.
Is it: sessionToken or sessiontoken?
I can't find the truth. If I see documentation it's sessionToken but in the postman api it's sessiontoken.
Then which one is the correct please?
Thanks,

Web service api is sessiontoken
javasacript is sessionToken
Thanks,

Related

IdentityServer4 Google sign callback doesn't include "IdentityConstants.ExternalScheme" cookie

I have an IdentityServer4 identity provider server. For the most part, I am using the template code from their repo. I am trying to add Google sign-in. I configured the GoogleSignIn in startup and added ClientId/ClientSecret.
When I don't configure the return URIs in the GCP project I get the following error from Google:
"The redirect URI in the request, https://localhost:44333/signin-google, does not match the ones authorized for the OAuth client. To update the authorized redirect URIs..."
When I add the URI
Then as soon as I call Challenge I immediately get a failed callback from Google.
[HttpGet]
public async Task<IActionResult> Callback()
{
var result = await HttpContext.AuthenticateAsync(IdentityConstants.ExternalScheme);
// Here, result.Succeeded is false
// Rest of the method...
}
What could be the problem?
If you have made it to the Callback method, then it sounds like Google auth has completed successfully. However, since the IdentityConstants.ExternalScheme cookie is not present, it sounds like you might have a little misconfiguration.
Once the Google authentication handler has completed, it will sign in using the auth scheme set in its SignInScheme property or the default sign-in scheme. It stores the claims from Google into a local auth method, such as a cookie.
What scheme is the Google authentication handler configured to use? If you're using the quickstarts, it may be using IdentityServerConstants.ExternalCookieAuthenticationScheme rather than ASP.NET Identity's IdentityConstants.ExternalScheme that you are looking for.

How to get an accessToken by linkedin

A client wants me to integrate his News from LinkedIn to his TYPO3 site.
Yes, I am one of more admins of the company page on linkedin, the app is verified by the client.
I have client_id and client_secret
When i do the request to get an accessToken, something like:
https://www.linkedin.com/oauth/v2/accessToken?grant_type=client_credentials&client_id=&client_secret=
the answer is
error "access_denied"
error_description "This application is not allowed to create application tokens"
I have no clue, what the necessary permissions are and where to set them.
Neither the linkedin backend nor the developers shows up with any proper link.
I know, this question has been asked before, but its about the permissions.
Please set me on the rail...
You are trying to use the 2-legged OAuth process which is by "client credentials" unfortunately that process is not available by default to all applications which is probably why you are receiving that message.
This is mentioned in the first paragraph of the documentation of the 2-legged OAuth process.
Your application cannot access these APIs by default
https://learn.microsoft.com/en-us/linkedin/shared/authentication/client-credentials-flow?context=linkedin/context
Your application needs access to enterprise linkedin products that can perform API requests that are not member specific in order to be able to use that process.
By default the application only have access to the 3-legged process which involve a GET https://www.linkedin.com/oauth/v2/authorization before making a request to get access tokens.
More information about the 3-legged process can be found here
https://learn.microsoft.com/en-us/linkedin/shared/authentication/authorization-code-flow?context=linkedin/context
I use the .net Packages CodeHelper.API.LinkedIn
.NET
using CodeHelper.API.LinkedIn;
LinkedInHelper _helper = new() {AccessToken = "{ACCESSTOKEN}" };
string _id = await _helper.GetAuthorID();
CURL
curl -H "Authorization: Bearer "
"https://api.linkedin.com/v2/me?projection=(id)"
More Information
CodeHelper.API.LinkedIn
Nuegt Pakcage

Google Calendar API v3 - get calendarId (email) from OAuth token object

How to get calendarId (user's email) from OAuth token object?
Details: Using the Google Javascript Client Library.
After authorization, I need to get the user's email, which is the calendarId from the token object.
For Google Plus, the docs say that 'me' keyword can be used to refer to current authenticated user. It doesn't work for Calendar API.
What should I do for calendar API?
Please help
The attendee list of an event will contain addresses. Are you saying that you are unable to initialize the Calendar service?
I resolved the problem in the following way:
https://developers.google.com/+/web/people/
The above link says how to retrieve the user information from the authToken by using the API: gapi.auth.setToken();

how can I get google analytics data using http request?

how can I get google analytics data using http request ?
I am using http://ga-dev-tools.appspot.com/explorer/ to get my ga datas , there is a button to get the ga link, I open the generated link in new window , it return an error info.
{"error":{"errors":[{"domain":"global","reason":"required","message":"Login Required","locationType":"header","location":"Authorization"}],"code":401,"message":"Login Required"}}
how can I send token to google togater with the link ?
You have to authorize your request with OAuth 2.0. See the documentation on how to create refresh and access tokens. Then pass the access token either with the Authorization header
Authorization: Bearer 1/fFBGRNJru1FQd44AzqT3Zg
or as query parameter access_token:
https://www.googleapis.com/analytics/v3/data/ga?access_token=1/fFBGRNJru1FQd44AzqT3Zg&...
You'll probably want to use the Analytics Reporting API
https://developers.google.com/analytics/devguides/reporting/core/v3/

Linkedin OAuth unauthorized client error

Getting this as the response:
{"error":"unauthorized_client","error_description":"the client is not authorized"}
In the final step of OAuth 2.0 to use LinkedIn APIs. Couldn't get any material regarding this, so could anyone please help me with this ?
I am calling it as POST method too.
I was getting this error when I was not passing the correct value in the client_secret value in the POST to retrieve the access_token.
Once I passed in the correct value (BTW, linked calls this parameter as Secret Key on the developer console), this started working for me.

Resources