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

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.

Related

Safari cannot open the page because the address is invalid after successful uber oauth

I'm linking to the uber api authentication endpoints (/authorize and /token) via iOS and after a successful login, it returns "Safari cannot open the page because the address is invalid". I've narrowed this down to an iOS specific problem because the same react-native configuration works for Android.
I've tried a number of solutions.
Clear safari browsing history, web data, iPhone update, etc. Nothing has worked.
I believe URL Schemes under URL Types in info.plist has a pay here, but I'm struggling to wrap my head around what I need to put there.
Any thoughts?
Upon successful authentication, uber should return an access token for the user.

Problem authenticating with SharePoint Online when using GetWebLoginClientContext

We've got an ASP.NET MVC web application running on Azure on which we want to expose search results from a SharePoint Online tenant. Users in the web app are authenticated on Azure AD, and we want to have them search as themselves (preserving their identity and not use a system account) so that they only see items in the search results that are relevant to them. I thought this would be quite a common requirement.
Using the SharePointPnPCoreOnline CSOM extentions, we were able to retrieve search results with:
var authManager = new OfficeDevPnP.Core.AuthenticationManager();
ClientContext clientContext = authManager.GetWebLoginClientContext("https://xxxxxx.sharepoint.com");
KeywordQuery keywordQuery = new KeywordQuery(clientContext);
keywordQuery.QueryText = "queryText";
SearchExecutor searchExecutor = new SearchExecutor(clientContext);
ClientResult<ResultTableCollection> results = searchExecutor.ExecuteQuery(keywordQuery);
clientContext.ExecuteQuery();
(The GetWebLoginClientContext method pops a new window which asks for user credentials if they are not already authenticated. Ideally we would like to have it done silently, but this was the only method wa managed to get working.)
During dev everything was working OK - we were getting the expected search results. However, once we published the web app to Azure we got the following error when trying to search:
502 - Web server received an invalid response while acting as a gateway or proxy server.
There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server.
One of the suggestions we found for solving http 502 errors was to clear the browser cache, but after we done so it no longer worked on the dev machine either. Instead of displaying a popup requesting user credentials, the popup now just displays the SharePoint Online tenant home page without any login prompt.
Does anyone have an explanation for this?
Or if not, a better way to have users search SharePoint Online without the popup displayed by the GetWebLoginClientContext method?
Solved this in the end not with the GetWebLoginClientContext method (which pops a window for the user to enter credentials) but with the GetAzureADWebApplicationAuthenticatedContext method which authenticates silently using an oauth access token. The problem was obtaining the right token to pass to the method, which we succeeded in doing by using MicrosoftGraphHelper.GetAccessTokenForCurrentUser(url) found here

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

Youtube integration with IOS application.

I am facing problem with integrating Youtube with my app in IOS. While making request to authorisation in order to get request token, i need to pass a redirect URL (similar to FB or Twitter integration).
Problem is that while registering my application to Youtube, i can see 2 redirect URI's present : "urn:ietf:wg:oauth:2.0:oob" & "http: //localhost".
If i am using any of these i am getting token id in browser itself without getting redirected to my app.
If I am using any other redirect URI, created within application then server is giving me error.
Any suggestions how to do this correctly so that browser redirects to my app after successful authorisation.
I think you are registering your project wrong.
In your dev console, you have to create a client id as "Installed application -> iOS"
All you will need is bundle id (package name) and/or app store id

Salesforce Remote Access Authorization Error

I am new to developing a Salesforce app and I am using OAuth 1 for authentication.
I am able to generate the Request Token, and I re-direct the user to the salesforce site.
Once I enter my credentials, I get a
Remote Access Authorization Error
There was a problem in setting up your remote access
with
oauth_error_code=1800
In my Login History page, it shows Status as Success for Application type OAuth.
I don't get any entry in my Debug Logs page.
I have enabled Development Mode.
Any ideas whats wrong?
So https://login.salesforce.com/services/oauth2/success is a stub URL for callbacks - and that is the screen you are seeing there, and the access_token variable is your session ID for the user. So the OAuth flow is working correctly.
In the code, you might check to see if oauthResponse.access_token is getting set correctly. If so, it looks like:
sfw.login( setupHomeView );
That is what should tell it to move from that page to the next UI page.
You might also check out the Force.com Mobile SDK (link). It also includes PhoneGap and has a great OAuth wrapper built in.

Resources