Box Authentication for v2? - ios

To Authenticate the app , simple way is I get a ticket by this method "GET https://www.box.com/api/1.0/rest?action=get_ticket&api_key=" and finally " https://m.box.com/api/1.0/auth/ " the url open up the login page in safari, it was easy in v1 iOS SDK.Now I could not able to authenticate after entering credentials and clicking login I cannot enter into my application. I have been facing authentication issue. How to authenticate using new iOS SDK v2 ?

What error u getting?
Also Try using POSTMAN Google chrome extension to do the authentication as a command line and try to implement on your real app, u will find supportive docs on Box website. Make sure all your parameters are correctly entered.

Related

Safari error on login Microsoft account with oauth2

I have a a problem on a Nativescript 5.1.0 project with Angular 4, I use the API nativescript-oauth2, and it works fine for Facebook and Google, but when I try to Login into Microsoft it does not do very well.
I can enter the e-mail account and password, even the permission screen is shown, but in this one when I press YES it crashes.
The problem is because of the property redirect uri (urn:ietf:wg:oauth:2.0:oob) for the Microsoft configuration, when Safari receives the redirect uri, Safari crashes.
I read that can be solved with a delegate, but it already exists in the nativescript-oauth2.
And the android browser does not show the error but it does nothing.
Help me please!!
With Microsoft oAuth, it tries to open your app with an URL scheme. You might want to setup URL schemes in your app like it's showcased in demo app for Provider, iOS & Android

Linkedin authentication using auth0 Firebase and Ionic

I am using auth0.com to create a seed project with Firebase and Ionic (under Apps / APIs).
However, I ran into this issue Invalid redirect_uri. This value must match a URL registered with the API Key. I did the following research:
linkedin : Invalid redirect_uri. This value must match a URL registered with the API Key
(Tried to use http://localhost:8100/auth/linkedin/callback in OAuth 2.0 Redirect URLs and not working)
https://naveengopisetty.wordpress.com/2014/09/15/linkedin-oauth-2-0-issue-invalid-redirect_uri-this-value-must-match-a-url-registered-with-the-api-key/ (http://localhost:8100/signin-linkedin not working)
https://www.drupal.org/node/2357091 (http://localhost:8100/linkedin/company/token is not working as well)
Regardless of what I changed in Linkedin app, the login popup url always has redirect_uri=https%3A%2F%2Fmyproject.auth0.com%2Flogin%2Fcallback
That means for some reason my redirect url didn't get change and somehow auth0 forced a "wrong" url in it?
Anyone has an idea how to fix this? Or is it auth0.com bug?
When using LinkedIn, you should follow the instructions on how to configure as an email provider from this link
The important part is that you must set https://{accountName}.auth0.com/login/callback as the Callback URL in the LinkedIn app you create. Did you do that?
Does this help?
Thanks!

Oauth 2.0 facebook provider in Chrome package app. Redirect-url issue

I'm dealing with Oauth 2.0 facebook provider in Chrome package app using chrome.identity namespace and the method launchWebAuthFlow (https://developer.chrome.com/apps/identity#method-launchWebAuthFlow) .
My url of the launchWebAuthFlow method is "https: //www.facebook.com/dialog/oauth?client_id={app-id}&redirect_uri={redirect-uri}"
Reading the docs of this api, the redirect-uri must to be like this https ://abcdefghijklmnopqrstuvwxyzabcdef.chromiumapp.org/provider_cb where abcdefghijklmnopqrstuvwxyzabcdef is the ID of the chrome app. (https://developer.chrome.com/apps/app_identity)
When i run this code, facebook shows me a popup, "configuration of app doesn't allow the given url" instead the facebook login form. Facebook has to be blocking the redirect-uri but i don't know how to proceed.
Thanks in advance.
I answer myself.
It's like Xan said, has to be on the configuration of the Facebook app and that is it. The url https://abcdefghijklmnopqrstuvwxyzabcdef.chromiumapp.org/provider_cb has to be written in the 'Site Url' in the Facebook app form configuration.

OAuth Facebook Login in Phonegap returns InvalidHeader error

I'm developing an app using Phonegap and it implements a Facebook login to save some data using the user_id as a reference. I'm using OAuth.io library to implement the login dialog and everything runs smoothly in the web browser and in Android but when I test the app in XCode and I tap the login button the following error appears.
Cannot find hostname in file:/// from static
code: InvalidHeader
message: Cannot find hostname in file:/// from static
My guess is that it has something to do with phonegap not making an external request since the app is not actually hosted in a domain but running locally... any thoughts?
Seems like you are using oauth.js library instead of phonegap version
In your main page "index.html" add reference to the correct js file
<script src="oauth-phonegap.js"></script>
Then follow the instructions here to build your application
I had a simular issue using oauth.io. Turns out it was my Ajax prefilter changing the REQUEST to Facebook(it was adding parameters to the header for each request). Wether this is your issue or not, what you need to do is compare a successful REQUEST to Facebook to an unseccussful one, that will show you where things go wrong. Alternativly a blank phonegap app with no extra code other then the required oauth code should work and will be a Good starting point to isolate your issue.
I have been using Phonegap 2 years before.Though I didn't connect to facebook before,I connected to other website by OAuth.I can show you my solution.
Firstly,you should know how OAuth works.You can read OAuth 2.0 from facebook developer website or other websites.
Secondly,you should know your target:token,uid,expires_time.The most important thing is token.
Thirdly,just do it.In 2010,I solve this problem by using Phonegap Childbrowser plugin(now Phonegap have a inAppBrowser) and a light server.
Why I should use a light server?The server can help me to handle the redirecting in OAuth service and do cache.
Step 1 : I wrote script to connect with my server,and my server connect to OAuth Service(facebook).
Step 2 : OAuth Service(Facebook) do response and redirect to Facebook login page.
Step 3 : After input username and password,OAuth Service(Facebook) will redirect to another url and do a callback with some code or token.
Step 4 : If you get the token,save it and use it to connect OAuth Service(Facebook) if you want.
When I saw "Cannot find hostname in file:/// from static " in your description,I know that maybe you get confuse in OAuth.Now,I suggest you some server side code to handle it and make your OAuth process possible.

Asana Connect (OAuth) - Issue when logging in via Google

When logging in via Google (through Asana Connect from iOS App) the following error gets presented in the browser window: 'invalid_request: The required parameter 'redirect_uri' is missing.'
Logging in via username and password works absolutely fine.
Is that an issue at my end or within the Asana Connect API ?
Any idea how to fix this issue ?
A very interesting thing though ... when going back to the app and logging in again, the authentication happens successfully without asking for user credentials, returning to the app with valid accessToken & refreshToken.
I too use GTMOAuth for mac. This error occurs because in a normal web browser when we click login with google account, a new browser window opens to get credentials. using GTMOAuth it embeds only a single webview and so its unable to present a new browser window for google credentials to be used.

Resources