I am trying to fetch some tweets from twitter using Grails. The twitter API now requires authentication via OAuth2 which I have done before in other frameworks and languages quite easily with some plugins/libraries however I cannot seem to find a working implementation in Grails. Most google searches seem to turn up results relating to using OAuth to authenticate users as the server where as I am trying to have Grails instead act as the client.
This plugin looked promising, however the repo for it appears to be broken as the following links to the binaries result in a 404.
https://repo.grails.org/grails/core/org/grails/plugins/twitter/0.2.4/twitter-0.2.4.pom
https://repo.grails.org/grails/core/org/grails/plugins/twitter/0.2.4/twitter-0.2.4.jar
Does anyone have a working implimentation for doing this?
Turns out the read me for the twitter plugin is incorrect and the plugin name should be twitter-service in the build.gradle ie:
compile "org.grails.plugins:twitter-service:0.2.4"
For those attempting to do a similar thing you may also have success with the java twitter4j library.
Related
I have created some APIs using JAX-RS jersey. I have been given task to secure them using Oauth 2.0. In google I found many articles in which they explain how can I access google API, facebook API etc. they told me how to access already created APIs
But my question is how can I make my API secure using Oauth in java so that when another applcation want to access, it needs to provide authorization and authentication token etc.
Can anybody help me with the code in java. you can suggest some even paid tutorial of udemy coursera if you know. I will opt for them. I am not using any framework like Spring or Springboot.
I would advies checking out the following page:
https://www.baeldung.com/spring-security-oauth-jwt
It makes use of keycloack for authorization server and spring for configuring the resource server.
I'm trying to implement Google OAuth in my rest services (built on jersey, using maven to configure dependencies).
I looked for resources online but none of them gave me a clear picture.
Moreover, I read up on google-oauth-java-client, but how to implement in my rest services. I'm using Angular2 as front-end technology.
Please help me find a path through this.
Hi I building an application in JAVA to grab information from JIRA by performing several rest requests, but i'm running into trouble with one where authentication is needed. From the JIRA web page i have found this https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Basic+Authentication. But i'm running into problems figuring out how to do this in java, and if there is another way that would be great.
Use the Jira REST Java Client Library, here is a tutorial to get you started.
we are trying to implement linkedin into our application and we want to use Rest API so we can share network updates via back-end using OAuth token to our own linkedin account
JavaScript API wont work for use because its token expires every 30 minutes and we have to login in every time (if more than 30 mins) to share network update. so we want to use REST API and OAUTH token to share network updates with java
we have considered Scribe and Spring Social (though spring social's linkedin module is still in release candidate as of now) but to use those library we need higher version of java and we are using java 1.2 right now with the application
is there a way we can still use the REST API and make OAuth calls to share network update or is there a Java library for OAuth that still supports java 1.2
Any help or direction would be appreciated
Thanks
There's no OAuth lib that works with the LinkedIn Api for java 1.2, in fact I'd argue that the only library that works well with all LinkedIn endpoints (because of some corner case encoding issues) is scribe.
Most of scribe code is 1.2 compatible. The only issues being some generics (Map<T,U>) and #Override annotations, which shouldn't be that hard to change.
If you're interested in digging the source and copy-pasting the bits you need (scribe is MIT licensed so you can do pretty much whatever you want with it), the core of the signature process is on this class.
Good luck.
I want to use openid authentication for my Google App engine project. For this I'm trying to use the openid4java library v0.9.6, but I'm getting the following error:
javax.net.ssl.HttpsURLConnection is a restricted class. Please see the Google App Engine developer's guide for more details.
The problem is pretty obvious and I found an issue saying that openid4java doesn't work with GAE since revision 658. The fix I tried was to checkout the code from revision 657 build it and use the resulting jar. No luck, I got the exact same error.
Any ideas of other workarounds for this issue?
I think the openid4java uses apache httpclient which is not allowed on GAE for https.
There's some workarounds -- you might have to unpackage the openid4java and replace code to use URLFetch instead of httpclient.
Here is one discussion that might help.