Implementing custom oauth-provider? - java

I want to implement Oauth-provider in such a way.
I have one project in which i am accessing the rest apis. Now i want to create my own oauth-provider for every api to hit.I google alot but count not found anything from which i can start my implementation.
I found google code for auth-provider but i am not been able to make it run. Code url is
auth-provider from google code.
In jsp once i say that create my oauth then i want to create oauth setting from my oauth-provider. So that i can get it and send it in header to test my api.
I also download IBM code but not getting how should i start.
IBM oauth 2.0 code
Please help me.
Thanks

Related

Google Cloud Java project cannot find endpoint library

I am trying to connect an app-engine application to a Tensforflow model running on a Vertex AI endpoint.
It works if I provide my personal authentication details but these need to be refreshed all the time.
Going through the documentation it sounds like App Engine can authenticate to an endpoint automatically using the endpoint APIs - Based on this example
Unfortunately Eclipse cannot find "com.google.cloud.aiplatform.*" and I am not sure which library should include this.
The documentation provides a list of all the standard libraries which can be defined in the Eclispe built-path but I am under the impression the endpoint API is not part of it.
Would be great to understand if there is a standard library I could add to make this work like "Google Cloud Platform Libraries -> Cloud Datastore"
Alternatively I could use another authentication method like an API keys but I could not figure out which service account needs which API key to authenticate against my end point.
Thank you
I am trying to compile the sample example provided here with Java 8 but Eclipse cannot find the library.
I was expecting to activate a standard Google Cloud library to get the example running and then figure out the authentication against the Google Cloud Endpoint.

Android : Step for Android connect to Laravel API

I am new in programming. And I would like to ask what is the step to connect Laravel API. Let say I want to build an Android App and I want to connect to the backend that is Laravel but the point is, the backend is not created by me it is created by other developer and I'm totally don't understand in PHP.
So in this situation, what is the step or how to do Android connect with the Laravel?
PS: I have already saw some sample from other article, but the tutorial mostly are build the both Laravel and Android at the same time. So that is quite not same with my situation...
So Hope I can find out the answer from here. Thanks in advance
You can use Retrofit for creating calling API service in your android application.
This is a very good tutorial: https://www.journaldev.com/13639/retrofit-android-example-tutorial.
For Laravel API, you can follow tutorial: https://www.toptal.com/laravel/restful-laravel-api-tutorial.
The very first step to interacting with a remote REST API is to have an understanding of what the expected request and response data is. This can typically be found in the documentation of the REST API you're trying to access. In this case, since it has been created by another developer, you should ask them for the docs.
After you've gotten a decent understanding of the API, you can use one of several HTTP client libraries for Android such as Retrofit to send requests and receive responses from the API.
Note: It is not necessary to understand the API's code, only the REST endpoints and the request/response schema. A good example of API documentation can be found here

How to implement OAuth in Bitrix for third party Applications?

I am currently using Bitrix24 for HR management and task management.
Since it provides an option to integrate third party applications with it, I am stuck in how to implement OAuth for my application with Bitrix.
I went through documentation provided by Bitrix24 but it uses php code.
Is there any sample JAVA code available for OAuth implementation?
Unfortunately havent seen any examples on other that PHP languages, but
if you are already experienced with Java it should not be a problem.
In case you are working with bitrix24 cloud edition - you need to
1) create application for marketplace using you partner account and obtain secret key and application id
2) send this secret key and application id from your application written on any language and receive
3) receive request token and refresh_token and use them to access rest api provided by Bitrix24 https://training.bitrix24.com/rest_help/
more details on what kind of request you need to do: https://training.bitrix24.com/rest_help/oauth/examles.php
hope this help you.
You can use API like this for JAVA
I am adding LEADS from the API, and updating the same LEAD
to add the LEAD:-
Method: POST
URL:-
https://.bitrix24.com/rest/crm.lead.add
Parameters:-
{"fields[TITLE]":"LEAD_TITLE","auth":"AUTH_TOKEN"}
It will add the new LEAD in you Bitrix Dashboard.

Wish to create desktop app that combines facebook and email accounts all in one go - stuck at the first hurdle?

first poster :)
As the title says, I am looking to create a desktop app which will notify me of changes on facebook and new emails, and the facebook part (the first part I've tried) is baffling me. I've never worked with an api before, and have no idea how to integrate facebook's api with this desktop helper I want to create. I will be using java to create this desktop helper.
Thanks in advance!
Here are few pointers for you to get started. Please feel free to ask for clarifications and I will edit my answer accordingly:
For facebook, you can actually pull all those info via their API. There are a lot of types for API, but Facebook specifically use REST API over http.
To simplify, think of it as making an http call with specific parameters and you will be getting an output back.
In order to use facebook API you need to understand their protocol including authentication/login and how to request for things that you want. This would require some reading to their documentation which is pretty complete and available at http://developers.facebook.com/docs/.
For the description of their API URL and the input/output documentation, you could directly jump to Graph API Documentation http://developers.facebook.com/docs/reference/api/.
In order to call their API via HTTP from Java, you could leverage HttpClient library from Apache Http Components project http://hc.apache.org/. They have plenty of tutorial and examples for how to make http call using HttpClient
For combining with all other emails accounts (per your question), you need to deal with SMTP or IMAP (whichever email protocol that you are planning to combine with Facebook). This is already built-in to Java via their Java Mail API collection
You then can poll this data on interval basis to get an update from Facebook and your mails
Once you have figured out how to get the data, the rest is just following a good MVC framework. That means separating out your presentation, data and controller (application logic). Make sure that you are separating the classes for #1 and #2 and each of them put their data to normalized data format that then get feed to your View (presentation layer)

Does twitter Java API like twitter4j work with statusnet?

I have tried to access my own statusnet with twitter4j, as I'm trying to build a special Client. Therefore I struggled through many trials. I want to access the statusnet with OAuth, which is provided by twitter4j. First I tried to login with twitter4j by loading statusnet appropriate properties from an own ".properties" file so that it fits the values needed by OAuth. As this didn't really worked well, I changed the custom values as streams and tokens of twitter4j into statusnet one's. This didn't work either as I still get an IllegalStateException thrown when I try to get the OAuth-RequestToken.
Has anybody got experience with writing a Client for Statusnet or another twitter-clone in use of a twitter Java API like twitter4j, especcially with OAuth?
I have it working with status.net (identi.ca) and basic auth - see https://github.com/pilhuhn/ZwitscherA/blob/master/src/de/bsd/zwitscher/account/LoginActivity.java#L124 and then
https://github.com/pilhuhn/ZwitscherA/blob/master/src/de/bsd/zwitscher/TwitterHelper.java#L232
Did you get a OAuth application id from status.net?
I have found a solution:
Use Signpost OAuth Api. This is the most simple way to instanciate a individual Oauth Application with individual provider URIs. You can see a example with Twitter here. Replace the Twitter URIs with your statusnet ones and have a try, works really fine and simple.

Categories