How to implement OAuth in Bitrix for third party Applications? - java

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.

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.

How to Create REST API For Phone Number Authentication in Spring-Boot Project?

I have created some API's for login but am not sure about creating a login with a Username/Phone Number. Can someone help out with any tutorials or any sort of idea on how to create a REST API for phone number authentication on a Spring-Boot Project?.
I also require a suggestion on how to bring the third party login like We log in with a google account on most of the web applications
From what I've understood in your question you are concerned about security and you would like to implement something like an MFA for your users.
Since sending OTP codes is expensive (not really but let's assume you want something free) and requires to access external APIs to send the codes (with its own logic) what I can suggest to you is using something like a TOTP (Google Authenticator or Microsoft Authenticator).
Here is a good (and most important WORKING) guide I've followed some time ago:
https://medium.com/javarevisited/spring-boot-two-factor-authentication-78e00aa10176
With the right adjustments and improvements (or simplifications in case) the main logic will be perfect for your application of MFA.
For the login using for example google/facebook/SAML SSO and so on I can suggest you check on OAUTH2:
https://www.baeldung.com/sso-spring-security-oauth2
Hope it helps
Hi Ninja please read this example and seraching internet
https://dzone.com/articles/add-login-to-your-spring-boot-app-in-10-mins

Java/Scala SAML client example needed

I'm writing some Scala code that will run on a server. It needs to periodically connect to Office 365 to pull some data using OData. I don't have access to AD to register an app. I'm using a username and password for authentication.
Are there any suitable Java or Scala libraries I can use for the authentication step? At the very least, I'd love to see some sample code in any language that shows the authentication step. (Please don't provide samples that use a .Net library for the authentication step. I need to be able to reproduce the logic in a JVM on Linux.)
There is an excellent example at https://github.com/onelogin/java-saml, which provides a class to prepare the request and a class to process the response. There are some things to fill in, but the wikipedia entry on SAML should be enough.

Access GAE datastore with spray

I want to use GAE datastore to store my data but instead of the java API we want to use the JSON API and making requests through spray.
But before I can even do any request I need to obtain an access token.
I can't figure out how this is done with either the Java API or any other means. Is there a way to obtain an access token which can then be used for the JSON API (through spray)?
Like many Google services, the Datastore API uses OAuth for authentication. The easiest way to use it is with one of the Google API client libraries.
Java: https://developers.google.com/api-client-library/java/
Java + Datastore: https://developers.google.com/api-client-library/java/apis/datastore/v1beta2
The documentation for the client does a pretty good job of explaining how OAuth works and how to get started calling APIs by registering your app with the Console.
(I'm not familiar with spray, but I assume you'd be able to use the Java client from Scala.)

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)

Categories