Issue with Linkedin integration using socialauth in android - android

I had implmented linkedin integartion in my android app using socialauth a year ago. It was working fine till few days back. Now it gives following error:
"org.brickred.socialauth.exception.SocialAuthConfigurationException: Application keys are not correct. The server running the application should be same that was registered to get the keys."
Tried using following default keys also.
api.linkedin.com.consumer_key = bh82t52rdos6
api.linkedin.com.consumer_secret = zQ1LLrGbhDZ36fH8
Getting same error for keys of app generated previously, default app keys and for fresh created app.
Any idea why it is happening? Is there any change in linkedin APIs?
Libs included : socialauth-4.4.jar, socialauth-android-3.2.jar.

This is due to the change in the Linked in developer program.
Changes are mentioned here https://developer.linkedin.com/support/developer-program-transition.
You getting this error because the default scope setting in the r_fullprofile which is as part of the change no longer available.
So to apply this changes in the socialauth API you should pass the scope permission as <prop key="api.linkedin.com.custom_permissions">r_basicprofile,r_emailaddress</prop>

Linkedin have updated their Scope for API , they have updated their APIs link:https://developer.linkedin.com/support/developer-program-transition
The following selection of profile fields are available to all LinkedIn developers:
Basic Profile Fields
Location Fields
Position Fields
These fields are not
Full Profile Fields
Contact Info Fields
Company Fields
Publication Fields
Patent Fields
Language Fields
Skill Fields
Certification Fields
Course Fields
Education Fields
Volunteer Fields
Recommendation Fields.
Additionally
only these Profile API — /v1/people/~ Share API — /v1/people/~/shares Companies API — /v1/companies/{id} will work.
Check your scope.

LinkedIn locked many parts of its APIs on May 12, 2015 according to https://developer.linkedin.com/blog/posts/2015/developer-program-changes
Since you're using the socialauth library, you will have to wait for its developers to push a new version. :(

Downloading 4.9 library solves this issue
You can get the jar from Maven directly:
http://search.maven.org/remotecontent?filepath=org/brickred/socialauth/4.9/socialauth-4.9.jar

Related

Leaked GCP API Keys : Your app contains exposed Google Cloud Platform (GCP) API keys. Please see this Google Help Center article for details

I am getting this error from Play Store:
I tried to limit the access of API key within that file but still getting this error. How can I solve this?
Make sure that keys are not leaked via sites such as GitHub.
Notice the message wording "Your app contains exposed ...". That message did not say your app is exposing the keys.
You will need to delete the key and create a new key, update your app, etc.
Delete current key and create new one. Also make sure you apply restrictions like HTTP referrers, IP Address restrictions etc. based on your use case. For more info, check this
https://cloud.google.com/docs/authentication/api-keys#api_key_restrictions
The error is due to the API key being included in your source code. Consider using Google's Secrets Gradle Plugin for Android to hide your API keys from source code. Documentation at https://github.com/google/secrets-gradle-plugin and demo by the author at https://youtu.be/X8lYNW_Or2o

Firebase authentification works but I get error when using the Google Text to Speech API

I've set up a small android and firebase app... Authentification works like a charm, and in the firebase console, I can see my user, logged in with the Google account.
Now I am trying to experiment a little with the Text to Speech api, and in doing so, I followed this tutorial:
https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/texttospeech/cloud-client
I managed to make the small java app work, by setting the GOOGLE_APPLICATION_CREDENTIALS Environment variable (I followed this tutorial for this step: https://cloud.google.com/docs/authentication/getting-started), but I am not sure what I need to do to make that code work in the Android app where the users are authentificated..
The Error that I get when trying to make a call to the TextToSpeech API is:
The Application Default Credentials are not available. They are
available if running in Google Compute Engine. Otherwise, the
environment variable GOOGLE_APPLICATION_CREDENTIALS must be defined
pointing to a file defining the credentials. See
https://developers.google.com/accounts/docs/application-default-credentials
for more information.
The error mentioned comes from the line:
TextToSpeechClient textToSpeechClient = TextToSpeechClient.create();
This error appears because of the fact that on the android emulator I don't have access to the credentials that are set as environment variable in my OS..So I have to provide the credentials in another way.
In the case of other Google APIs, like Storage, I found out that this can be done like this:
// You can specify a credential file by providing a path to GoogleCredentials.
// Otherwise credentials are read from the GOOGLE_APPLICATION_CREDENTIALS environment variable.
GoogleCredentials credentials = GoogleCredentials.fromStream(new FileInputStream(jsonPath))
.createScoped(Lists.newArrayList("https://www.googleapis.com/auth/cloud-platform"));
Storage storage = StorageOptions.newBuilder().setCredentials(credentials).build().getService();
I managed to create the GoogleCredentials object with the contents of the json file, however the TextToSpeech client doesn't seem to provide a functionality similar to this:
StorageOptions.newBuilder().setCredentials(credentials).build()
So my question is....is there a way to provide the Credentials object to the TextToSpeech client?
Thanks
Currently, there is not a way to provide credentials to the TTS Client from this page.
Due to Security / Auth reasons, I believe the best suggested approach is to use Firebase Functions.
Get the Text
Call Firebase Functions
Have Firebase Functions call the TTS API
Return the results.
This way, no keys are leaked inside the application and you can use Firebase Auth.
Let me know if that helps!
Update:
Option 2: iOS Tutorial (should be adaptable to Android)
Get the Text
Call Firebase Functions
Have Firebase Functions return an OAuth2 Token
Use the token directly with the API

Android app facebook upgrade from v2.6 to v3.0

I have an Android app and Facebook developer portal has requested me to upgrade.
According to the API upgrade tool, it has 3 items
Items to fix to upgrade Graph API from v2.6 to v3.0:
Facebook Login2.0 - In v2.7 of the API, you will need to request business_management to manage your business account. (New)
GET {user-id}/permissions2.0 - Starts enforcing the app's restrictions (such as country or age ) on API calls made without the application's ' appsecret_proof'in the request. (Change)
GET {user-id}/permissions2.0 - GET /{user-id}/conversations and GET /{page-id}/conversations will return fewer fields by default. Use the 'fields' param to explicitly ask for the set of fields you want. If you ask for an explicit set of fields, the response will not contain any extra fields that you did not ask for (Change)
its not really clear what are the steps to upgrade. Can anyone give some guidance. Thanks
Ok I already managed to update it just by change the version in advance setting at developers.facebook.com It looks like the thing that it told to fix in update tools just apply if you use that particular code only

Deprecation of v1.0 of the API - What do I change to my existing code?

I am new to android development and learning. I'm creating an app which stores favorite twitter searches as tags which are clicked on and opened with. In my strings.xml I defined one of the tags as: <string name="searchURL">http://search.twitter.com/search?q=</string>
When I use the http://search.twitter.com/search?q= URL, I'am introduced to:
The Twitter REST API v1 is no longer active. Please migrate to API v1.1.
https://dev.twitter.com/docs/api/1.1/overview
I was wondering, what changes I should make to migrate to new version. Is it a simple change in the searchURL ?
from the link you sent:
At this time, all authentication requires user context, but in the
coming weeks we'll be pushing out support for a form of authentication
not requiring a user context.
I think that perfectly answer your question, isn't it?

2 different Google Calendar Sample Codes - Which examples I should apply?

I go through 2 different Google Calendar code samples. After finished reading them, I am getting confused.
https://developers.google.com/google-apps/calendar/instantiate
They are using oAuth2?
They are using scope https://www.googleapis.com/auth/calendar. Is it because they are using oAuth2?
They required 2 API keys, clientId and clientSecret. Is it because they are using oAuth2?
They are using com.google.api.services.calendar.Calendar.
http://code.google.com/p/google-api-java-client/source/browse/calendar-android-sample/src/main/java/com/google/api/services/samples/calendar/android/CalendarSample.java?repo=samples
They are using ClientLogin?
The scope is cl? Is it because they are using ClientLogin?
They only require 1 simple API access key. Is it because they are using ClientLogin?
They are using com.google.api.services.calendar.model.Calendar. What is the difference with com.google.api.services.calendar.Calendar?
My target platform is on Android. Should I be using method from 1st example, or 2nd example?
The second example is using Android functionality of AccountManager which can access stored account information on an Android device. The AccountManager class will do the OAuth in the background, so that the developer doesn't need to. See previous question.

Categories

Resources