Please tell me if there is some sample code that allows you to log in to Google Spreadsheets using Java and Google OAuth 2 without recourse to the browser?
I found them a code sample, but it is only for .NET
An overview of using OAuth2 with Java can be found here: https://developers.google.com/api-client-library/java/google-oauth-java-client/oauth2
You can learn more about using OAuth2 and Java to perform authentication and authorisation for Google services here:
https://developers.google.com/api-client-library/java/google-api-java-client/oauth2#overview
Both guides instruct the reader on how to use the OAuth2 API and include Java code samples.
Related
I am trying to connect from Java to the Sharepoint Online REST API.
I previously used a SharepointOnline ADD-IN registered directly in the Sharepoint system that has permissions to all the site collections (FullControl).
I got the token with the app credentials from the url:
https://accounts.accesscontrol.windows.net//tokens/OAuth/2
I can make requests to the Sharepoint REST API directly
Now I have to switch to an Azure registered app.
The code is written in Java and I use the Azure sdk-com.microsoft.azure (artifactId-azure). I can successfully retrieve a token, but this is not valid for later requests to the Sharepoint REST API.
I get this error:
'Microsoft.IdentityModel.Tokens.AudienceUriValidationFailedException' was thrown."
Is there any possibility to get a valid token for Sharepoint REST API requests?
Yes this is possible. Check out the below document:
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azuread
When using SharePoint Online you can define applications in Azure AD and these applications can be granted permissions to SharePoint, but also to all the other services in Office 365. This model is the preferred model in case you’re using SharePoint Online, if you’re using SharePoint on-premises you have to use the SharePoint Only model via based Azure ACS as described in here.
Hope this helps!
You can take a look of this project i've develop (and i'm currently working on it on my free time) where you have a working implementation of a java API to communicate with sharepoint rest api v1 and perfom common operations (rest api is still not fully covered but has most common operations and also provides a starting point with working examples). You can take a look of it at
https://github.com/kikovalle/PLGSharepointRestAPI-java
I am looking for building an iOS/Android and Angular app with Java at the backend(REST API). Java will use spring framework. I am looking for the options for User authentication. iOS/Android App will be used by the client and Angular web app will be used my management. Angular web users will have different roles so requirement requires authentication(email and password) as well as authorization. Considering this I was thinking of using Spring Security with a custom UserDetailService. However I guess that will have issues with cookies. I looked into AWS Cognito Identity and Firebase and got more confused. It will be a great help if someone can share there experience with such requirement.
i had created basic login application in angular application by referring the links:
http://jasonwatmore.com/post/2015/03/10/angularjs-user-registration-and-login-example-tutorial
and i have used cakePHP3 for rest API generation and Token is generated on the the basis of JWT, JSON Web Token (JWT) is a JSON-based open standard used for passing claims between two parties in the context of web application environment. These token are specially designed to be very compact and URL safe. Their usability in the context of web browser single sign-on is also remarkable. JWT claims are useful for passing identities’ verification between service providers and identity providers. you'll find the reference links on internet.
for android and IOS you need to learn JSON parsing first. In android, JSON parsing can be done using OKHttpclient/Volley "android hive" is best site to learn jsonParsing and in IOS jsonParsing can be done using AFNetworking.
Hope this will help you.
The Ideal Project for you is Spring Security OAuth2. With this you can make your REST API Stateless and no need to worry about Cookies and Sessions.
I have created a Web application in Google App Engine java. Now I want to provide the authentication functionality. User can use his twitter(in future I will provide other OAuth Service provider too) account for login. I have found couple of libraries for twitter authentication like twitter4j. I don't want to use any such kind of library that specifically work for single social site like Twitter, facebook etc. I thought to do oauth implementation by my self. I have pretty good knowledge about oauth mechanism and found google oauth java client library. This library provide the functionality of oauth and is not dependent to any kind of social site(to my knowledge). Unfortunately I didn't find good examples on this library. Can any one help me about the examples, tutorials or any other library that is not dependent to any particular social site.
You can refer http://planet.jboss.org/post/setting_up_google_oauth2_with_java as well as http://googlecode.blogspot.in/2011/09/google-apis-client-library-for-java-now.html links
What are the basic requirements (library) to access gmail using Oauth2 3 legged?
Is there any java library supported for this access?
Any kickstart example using java?
I found the example from google, but it seem like using python script to get access token. And I am getting confused.
Any inputs will be helpful.
There are two high level steps to access the Gmail APIs using OAuth2:
Obtain a user access token. To accomplish this, read this guide first, it contains the basic steps. Then, checkout the Google OAuth2 Java client library, which has convenience classes that abstract away some of the low level protocol details.
Use the token to authenticate w/ Gmail IMAP/SMTP and start reading mails! You already found out the relevant library in your link included in the question.
Use the token to authenticate w/ Gmail IMAP/SMTP and start reading mails! You already found out the relevant library in your link included in the question.
I need to use oAuth in order to login to my website (with a Twitter account). The backend of the website will be created using Java and the front end will be created using JSP/JSF. Is there any Java based stable API that i could use to connect to Twitter using oAuth ?
Note :
I am aware that there is OAuth and xAuth, i think xAuth uses a pin verification method. What i want to have in my site is a OAuth verification that doesn't use a pin based verification method.
twitter4j - stable and active.
I'm a big fan of Scribe
I created an simple JSP/Spring/twitter4j example.. Twitter OAuth
if you are using Spring you can use Spring Social which can do this for you.