Redirect URL in Android Native App - android

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.

Related

login with outlook successfully but Redirect Url not working after login successfully - react native

am working on react native app and using react-native-app-auth library login with outlook,
when i run app on ios device then redirect url working fine.
but when i run app on android device then then login successfully but redirect url not working.
my redirectUrl is : 'urn:ietf:wg:oauth:2.0:oob',
i try this but not work.
manifestPlaceholders = [`enter code here`
appAuthRedirectScheme: 'com.googleusercontent.apps.urn:ietf:wg:oauth:2.0:oob'
]
Faced the same issue. Post some reading, came across this . https://github.com/openid/AppAuth-iOS/issues/194 which redirects us to RFC 8252 Section 7.1.
Please change it to a domain under your control as advised. Worked for me!

Given URL is not allowed by the Application configuration while login using facebook Jquery mobile [duplicate]

Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.
I have researched the most popular questions on SO already (Question 1, Question 2, Question 3, Question 4, and Question 5)... None of them help with my situation.
I have the application settings laid out like this...
App Domains: azeverything.com
Sandbox Mode: Disabled
Website with Facebook Login
Site URL: http://azeverything.com
****App Domains*** requires that no protocol be identified and Site URL requires that a protocol be identified.*
I have tried using www.azeverything.com and that didn't work either. Everything seems to match up. By the way, this is a WP site. I'm not developing locally either. It's all live.
Try to check at Settings > Advanced. At Valid OAuth redirect URIs, make sure you have a correct domain.
Hope it works.
You need to add the URL to your app:
Go to the app, you want for user login, on the Facebook Developers page
Click on the settings tab
Click add platform
Select Website
After selection it will ask for some details such as URL for your website which uses login with facebook feature, fill the form and submit it
That's all and you are done. Make sure that the app's URL is the same from where you're logging in.
Under Basic settings:
Add the platform - Mine was web.
Supply the site URL - mind the http or https.
You can also supply the mobile site URL if you have any - remember to mind the http or https here as well.
Save the changes.
Then hit the advanced tab and scroll down to locate Valid OAuth redirect URIs its right below Client Token.
Supply the redirection URL - The URL to redirect to after the login.
Save the changes.
Then get back to your website or web page and refresh.
This is a basic breakdown for slow people like me, and I didn't see this mentioned before.
The "redirect uri" isn't the place where you're redirecting to, but where it's coming from.
Say you have your app at http://myFBapp.com listening to /auth/facebook, and after they log in, redirecting them to /UserLoginHooray. The "Valid OAuth redirect URIs" should read http://myFBapp.com/auth/facebook, not http://myFBapp/UserLoginHooray.
Explanation:
HTTP Requests that have been redirected (302) include the original address in the header, so Facebook is merely putting a very basic layer of security on the request.
I chased my tail on this issue for hours. My coder and I could login with FB without a problem but my wife couldn't. She would get this topic's subject message. I tried every setting and URL that I could think of for my Lavarel app.
My issue was that my wife was signing in from:
http://www and we were using http://
A short trip to CPanel and a redirect fixed that. Hope this helps someone!
For Lavarel these FB app settings worked for me:
Settings/Basic - App Domain: mydomain.com , Site URL: http://mydomain.com/login.
Settings/Advanced - Client OAuth Login: Yes.
Settings/Advanced - OAuth redirect URIs: http://mydomain.com , http://mydomain.com/login.
App Details/App Center listed platforms = No. I'm only using the login for now.
I have a website with facebook login.
It has been stable and working for months.
No code change has happened for weeks.
Then, suddenly, the facebook login gives an error message:
Error
Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.
After debugging "for awhile", I reset my facebook app secret and it started to work again!
Michael Blackburn's answer helped me resolve my issue, but I want to give more detail on my fix.
I have a php app that posts to a user's FB page.
I own two domains:
http://app.my-web-app.com
http://app.mywebapp.com (no hyphen)
I built my site off the first domain because it read better IMHO (at least it did at the time).
Some users typoed the url so I bought the second one with no dashes for that reason.
So, one of my users was having the "Given URL" error.
Turns out he was going to http://app.mywebapp.com and the rest of them were going to http://app.my-web-app.com
I fixed everyone by adding all possible redirect URIs:
Granted, there are 100 better ways to implement this, but here is the workaround for now.
1.Make Sure Website Url and platform added, if not then visit https://developers.facebook.com/quickstarts/ then Select
Platform -> Setup SDK -> Website Url And so on..
Note: website url can't be like this : https://www.example.com just remove www and make it simple and working ;)
2.Goto App Dashboard -> Setting -> Click on Advanced Tab then go to bottom of the page and enable Embedded Browser OAuth Login
and leave Valid OAuth redirect URIs blank and Save it
I found Valid OAuth Redirect URIs under PRODUCTS then Facebook Login > Settings not as everyone is stating above. I am supposing this is a version issue.
It still didn't work for me. I guess I really have to add Android Platform rather than just the Website. This is annoying because my app is still in development mode :(
UPDATE: I'm using Expo to develop my react-native app and used info provided here: https://developers.facebook.com/apps/131491964294190/settings/basic/ to set up the Android and iOS platforms. This resolved the issue for me.
Sometimes this error occurs for old javascript sdk. If you save locally javascript file. Update it. I prefer to load it form the facebook server all the time.
Go to facebook developer dashboard
Select settings -> select WEB(for website) -> Add platform
Add your site URL.
This should resolve your issue.
So... facebook distinguishes pretty harshly between http and https in your app. This is just another small thing to check if you run into trouble.
I solved this issue by specifying correct site URL in my App Settings.
It works fine now. You have to specify your website Url such as http://www.xyz.com/
Under advanced tab make sure "Valid OAuth redirect URIs" contains valid URI or leave it empty(not recommended)
"http://example.com/"
instead of
"http://www.example.com"
sometimes you need to check your code (the part of redirect)
$helper = new FacebookRedirectLoginHelper('https://apps.facebook.com/xxx');
$auth_url = $helper->getLoginUrl(array('email', 'publish_actions'));
echo "<script>window.top.location.href='".$auth_url."'</script>";
if any changes happens there (for example, the name of your application "https://apps.facebook.com/xxx" in relation the application settings in facebook, you will get the above error
For Android Developers,
Make sure you have enabled Facebook Login inside the Products list inside Dashboard of your Facebook project app and have added all the required details as you go through the whole flow.
The login should work without giving the same error.

Remote WebScripts invocation of Alfresco in Android App.

I am tring to invoke WebScript in Alfresco remotely using the URL http://192.168.1.2:8080/alfresco/service/sample/folder/Company%20Home and the url will promth me with the authentication window allowing me to entire the username and password. This invocation works completely fine in the Browser..
Followed the steps described in the alfresco : http://wiki.alfresco.com/wiki/Web_Scripts
But when im tring to do the same in android app using webview im facing Authentication Error (HTTP Status 401-Error) and its not promthing me with the authentication window.
If you want to integrate it with an application you can better use the Login Webscript.
So in your app, just make a configure view, which stores the user + pass (encrypted). And then before you do the request login and then with the ticket Authentication call your webscript.
It will then look like this: http://192.168.1.2:8080/alfresco/service/sample/folder/Company%20Home?alf_ticket=<TICKET>
Sometimes that doesn't work, then use http://192.168.1.2:8080/alfresco/service/sample/folder/Company%20Home?ticket=<TICKET> instead.
Good luck!

facebook android allow permission window problem

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

Android -- Twitter Oauth -- Many different methods, none seem to work. Help

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....

Categories

Resources