I'm beginner with android and developing an application in android to connect to facebook and upload photo using the android facebook sdk.
Problem is when I login I'm getting an allow permission window. When I click allow, its not giving any action.
Any ideas on the problem?
After you authorize Permissions on Facebook, Facebook will redirect your to a confirm url you told the system to redirect to. Please check if you pass that url after approval redirection in the next parameter (assuming you use webbased authentication)
I've done from a PHP server this way:
function promptForPermissions() {
global $permissions;
$gateway="http://www.facebook.com/connect/prompt_permissions.php";
header("Location: ".$gateway."?api_key=".API_KEY."&ext_perm=".join(",",$permissions)."&next=".URL_AFTER_APPROVAL."&cancel=".URL_IF_CANCEL."&display=touch");
}
where the urls were having this format:
http://www.example.com/callback.php?permissionsApproved=1
http://www.example.com/callback.php?cancelled=1
Related
I have recently integrated google smartlock with my app. Currently, I am trying to save FB credentials with the following code.
Credential.Builder builder =new Credential.Builder(user.getEmail()) //FB Email
.setAccountType(accountType) //IdentityProviders.FACEBOOK
.setProfilePictureUri(uri); // Facebook graph image url
// with host graph.facebook.com
When I request the credential from the smartlock , I am not able to see user image associated with user FB profile account on the dialog that appears asking user to select the account to login in the App. One thing I have observed that if I use static url like below then it is working fine .
https://www.cleverfiles.com/howto/wp-content/uploads/2016/08/mini.jpg
But If I use dynamic url like the one below which needs url redirection then it is not working.
https://graph.facebook.com/XXXXXXXXXX/picture?height=200&width=200&return_ssl_resources=true
Does anyone facing the same issue ?
This is a known bug in Play Services not handling the redirect correctly, it's on the backlog to get fixed, sorry about that.
I am trying to implement SSO using this Azure adal library in a native android application.
I could not see any documentation on Redirect URL in android, Once I enter valid user name and password in microsoft portal, I could not redirect to my LoginFragment using Redirect URL.
My AuthenticationContext object looks like this.
AuthenticationContext mAuthContext;
mAuthContext.acquireToken(
wrapFragment(LoginFragment.this),
Constants.AdlaConfig.RESOURCE_ID,
Constants.AdlaConfig.CLIENT_ID,
"https://LoginFragment", // Redirect URL
"",
PromptBehavior.Auto,
"nux=1",
getCallback());
On debugging i could see that this is an Redirect issue, any help guys!
It sounds like you had resolved your issue. As references, the document list below may be useful for understanding about authentication & SSO on Android.
How to configure a native client application
Add authentication to your Android app, and the section about redirect url on Android App
How to enable cross-app SSO on Android using ADAL
Hope it helps.
Hello I am using Cordova app using Visual Studio 2015 community and simply login in the app using google authentication it's pretty fine login is done by open it in new window but after login it gives me the three pop up messages and than don't do anything.
The messages are (which are coming after login process and gives allow permission):
1) gap_init:2
2) gap:[null,"CoreAndroid","messageChannel","CoreAndroid237153815"]
3) gap:[null,"CoreAndroid","show","CoreAndroid237153816"]
by pressing these messages as "OK" it's just showing me my first page in the same popup window from where I logged in using Google and returned url after login is:
http://localhost:4400/?code=4/chL63O9SMzMFZGOlqcB9TFMVUFxWj0E4GYEuVFDQ3gM#.
My configured url settings in console.developers.google.com are:
Authorized JavaScript origins = http://localhost:4400
Authorized redirect URIs = http://localhost:4400
and when I am calling the api in that in redirect_uri I pass localhost://4400
I am supposed to go on the second page after login and give allow permission i.e. index2.html but no such process takes place after window gets popped up.
In mobile it open's the browser but don't come back to application for further process staying there after allow process done and finding the coming url i.e.
http://localhost:4400/?code=4/chL63O9SMzMFZGOlqcB9TFMVUFxWj0E4GYEuVFDQ3gM#.
Where am I doing wrong please suggest me anyone as soon as possible. Thank you
IF you have placed cordova.php in root try reload after renaming it
I;m newbie to Android Development , i'm working in a small project that helps me to learn Android , it;s a Twitter Client , i'm using OAuth for authenticating the user to use Twitter's services and not using any callback urls, so i have to forward the user to a specific Twitter URL to get the PIN to continue the authenticating processes , after forwarding the user to the URL i wanna to force him to go back to my preferences activity write the PIN to continue the process , how this can be achieved ? any new ideas are welcomed..
I have an example here using oauth to login to twitter on android without using the pins.
Not sure if this is the same but there is a tutorial on how to do the whole end-to-end twitter OAuth integration here with Twitter4J, and that returns Twitter to the activity to write the access details to the SharedPreferences by using a Callback url and handling the writing of the details in the original activity onResume() method.
It passes the Callback URL to the request to retrieve the tokens and then there is an Intent-Filter in the Manifest XML to return the request to the calling Activity.
Hope it helps.
I can't get Oauth to work with Twitter. I have tried the following (all result in the same 401 error):
jTwitter (using the default OauthSignpostClient)
jTwitter using the commonshttp library (CommonsOauthProvider) instead of the "DefaultOauthProvider"
jTwitter using the OauthScribeClient (instead of the OauthSignpostClient)
oauth-signpost (by itself... no jTwitter)
Twitter4J
http://code.google.com/p/agirardello/
http://dev.bostone.us/2009/07/16/android-oauth-twitter-updates/
http://github.com/kaeppler/signpost-examples/blob/master/OAuthTwitterExample/src/TwitterMain.java
I've tried my own implementation and copy/pasted the sample code from each of the sites, and nothing seems to work. I'm also 100% sure I also downloaded and included any dependencies (where needed).
Here's the interesting part. Using jTwitter and the oauth-signpost library, I can initiate a connection to Twitter, open a browser window for the user, have them log-in and generate a PIN for my app. When the app goes to post a status update however, (using the pin, and the stored access token and token secret), the 401 error pops up. All other things I've tried won't even let me open a browser window and ask the user to generate a PIN (they die with the 401 error on the request for the "request token").
Please help. Thanks
I don't know if it will help you much with Android, but this post on Twitter OAuth by Chris Shiflett just came up on my interwebs.
First of all for OAuth you need to register your application with twitter I am assuming you have registered it. Now in case of desktop and mobile application you need request twitter for custom callback URL, as default callback url just works only for web apps. Once twitter approves requested call back URL , it will work .
But there is workaround, rather than OAuth request twitter for xAuth by submitting details of your applications. Then if twitter approves it , you can uses xAuth which works almost similar to OAuth.
Make sure your application had read&write access when you created it....