Making additional Oauth calls to Linkedin API after authentication through SecureSocial - java

We're using the SecureSocial module to authenticate users with the LinkedIn API https://github.com/jaliss/securesocial. This works well, and the user is authorized. However, we want to populate the user profile with information from LinkedIn afterwars, and I don't know how to properly make that API call.
We have the access token (containing the oauth_token and oauth_secret), but I'm not sure how to use these fields in the next call. According to the LinkedIn API docs, I need the following fields to make another successful call to the API: oauth_consumer_key, oauth_token, oauth_signature_method, oauth_signature, oauth_timestamp and oauth_nonce. I don't know how to get access to, or generate, these values. I tried using this URL: "http://api.linkedin.com/v1/people/~?&" to no avail.
We're using Play! Framework 2.0.2 and Java.
Any help would be greatly appreciated!

Have you already looked at the SecureSocial source code for the LinkedIn provider?
Even if it is Scala, I think it is possible to write a Java class based on it.

Related

guide to use the MASL java SDK to authenticate user in azure function developed in java

Please help me to find out the documentation on how to use java MASL SDK to get access_token for a service principal.
I am looking to find the documentation or GIT links which can guide me how to use the MASL library including the code samples.
I have gone through this link but it does not help me much : https://learn.microsoft.com/en-us/azure/active-directory/develop/msal-authentication-flows
And, I am not expecting code samples to be shared here. I just want to find out where to find such data. I am struggling a lot when it comes to finding the right knowledge with respect to azure learning. What am I missing here? Is there any azure reference link available to find such information at a centralized place?
Note that, based on your requirement you can make use of Authorization code Flow if you want the user to sign-in and authenticate and if you want to access API using Application then make use of Client Credential Flow.
I tried to reproduce the same in my environment and got the results like below:
I created an Azure AD Application and added API permission:
For Client-Credential Flow, refer this GitHub blog by siddhijain.
Use the MASL java SDK to authenticate user in azure function developed in java.
Assuming that you want to authenticate user, you can make use of Authorization code Flow to generate access token.
I generated the Authorization code by using below endpoint:
https://login.microsoftonline.com/TenantID/oauth2/v2.0/authorize?
&client_id=ClientID
&response_type=code
&redirect_uri=RedirectUri
&response_mode=query
&scope=https://management.azure.com/user_impersonation
&state=12345
A sign-in screen will appear for authenticating the user:
To generate the access token, I used below parameters:
https://login.microsoftonline.com/TenantID/oauth2/v2.0/token
client_id:ClientID
client_secret:ClientSecret
scope:https://management.azure.com/user_impersonation
grant_type:authorization_code
redirect_uri:RedirectUri
code:code
I am able to call the Function by using above generated access token:
To implement the above in MSAL Java library, refer the below GitHub Blogs:
Microsoft-authentication-library-for-js/msal-node/auth-code AzureAD by derisen
Microsoft-authentication-library-for-js/samples/msal-node AzureAD by rgins16

Is there any example source code in spring boot and feign available for calling docusign eSignature REST API directly and not use an SDK?

I am trying to implement a spring boot application with DocuSign for getting all Envelopes and generating signing ceremony URL links for individual Envelopes which will be displayed in my app to the signer. I am not able to do it because I am not getting how to do authentication and which type of authentication I need to use. Should I use SDK or without SDK I should do? Any example source code for reference.
From your question, it sounds like the people who will use your app are signers. Therefore they will typically not have a DocuSign account login.
So:
You should use DocuSign's JWT OAuth flow. Use it to obtain an access token for a "system user" in your DocuSign account such as hr_department#yourcompany.com
Use the user version of the JWT flow, not the application version. Here is the implementation of the requestJWTUserToken method.
Best would be to include the SDK in your project and call the requestJWTUserToken method. If you can't do that, then you can copy the source into your app.
The SDK works with Spring-Boot.
Use the resulting access token in your app to call the eSignature REST API

Using Search Console API v3 (Search Analytics) without Oauth, just API key

I've tried this code and it works.
https://developers.google.com/webmaster-tools/search-console-api-original/v3/quickstart/quickstart-java
But it uses Oauth and it requires a redirect. Is there any way to use just an API key without having to redirect to a browser?
I understand I can just make http request using this:
https://developers.google.com/webmaster-tools/search-console-api-original/v3/
But I wonder if there's any Java API I can use, like in the first example.

Get idToken using Paypal REST API

I am building a REST API to login to my system using PayPal credentials.
I'd like to use the PayPal-Java-SDK and I've succeeded to get all the info I need for a given PayPal account (starting from the Auth Token).
I had a look at Paypal Spring Social and I found another token I wasn't considering in my implementation. It's called IdToken. For example here
I tried to search online, but I couldn't find much info about it.
Why is that token needed?
Is there a way to retrieve it using the REST API?
Thanks
I think I misunderstand the SDK. It doesn't seem to be currently supporting OpenId. That's why I couldn't retrieve the IdToken with it.

Facebook user authentication in java

I am able to load my app in facebook iframe, but can anyone help me with the user authentication in java. Any help will be really appreciated. Thanks
All java API clients provide extensive documentation on authentication. Here are two:
restfb
spring-social-facebook
Authentication follows the OAuth dance, which includes exchanging tokens. A tricky bit is that you should store the initial request token in your session, in order to be able to get it when facebook redirects the user back afterwards.
You can use a sdk like this one or you can find your way trough the facebook api, the requests are simple.

Categories

Resources