Setup application to use Microsoft accounts with hybridauth - hybridauth

I want to set my app's redirect URL to "http://www.mydomain.com/hybridauth/endpoint?hauth.done=Live", in Microsoft account Developer Center it tells me that
"You must enter a valid domain that begins with http:// or https:// - query strings are not allowed. Length is limited to 248 characters."
the login button redirects to the following url
https://login.live.com/err.srf?lc=1033#error=invalid_request&error_description=The%20provided%20value%20for%20the%20input%20parameter%20%27redirect_uri%27%20is%20not%20valid.%20The%20expected%20value%20is%20%27https://login.live.com/oauth20_desktop.srf%27%20or%20a%20URL%20which%20matches%20the%20redirect%20URI%20registered%20for%20this%20client%20application.
Any way I could link to that URL?

It seems to be a bug in the Live provider implementation.
You must edit the hybridauth/Hybrid/Providers/Live.php file and change the line below:
$this->api->authorize_url = 'https://oauth.live.com/authorize';

Related

Client_ID value is now snowflake

I am trying to invite my Discord.js bot to a server but whenever I use the URL, it says CLIENT_ID "(my client ID is in here)" is not snowflake.
What does this mean, I've looked about but haven't seen any fixes to this problem. My redirect URI is https://discordapp.com/oauth2/authorize?&client_id=[CLIENTID]&scope=bot with CLIENTID as my client ID. I'm not fully sure on how to use a redirect URI properly, as for my other bot(in python) I didn't need it.
This appears to be an issue with the ID you substituted into the URL, double check the ID you provided is right and corresponds to the bot; if this turns up okay, I would recommend generating an invite URL through the Discord developer portal.
If you navigate to the Discord Developer Portal and click on the application you want to invite (your discord.js bot) it will open the application's page. From there click OAuth2 on the side panel then URL Generator and select the scopes and permissions you want for the bot and Discord will generate the URL for you.
On a side note, the programming library or language you use will have not affect on the invite link.
I had this same issue, for me it turns out my client id ended up having a semicolon at the end because Prettier auto-appended it to my .env file.
Try printing out your client ID and make sure it's just a string of numbers like this
CLIENT_ID = "123456789876543210"
with no other characters in it

Correct Format of Harvest API OAuth2 Redirect URL in iOS Application

What is the correct format for a redirect URL when authenticating with OAuth2 and the Harvest API from an iOS application?
oauth.com states that a redirect URL for a native application can look like myapp://callback. Problem is, Harvest doesn't accept such a redirect URL. It seems to require prefixing it with http/https, which causes problems when redirecting back to the iOS application at the end of the authentication flow. I don't seem to find anything relevant in the Harvest API documentation.
I have added a URL Type in Xcode where I set the Identifier value to com.example.myapp and the URL Schemes value to MyApp. No matter what redirect URL I specify (given the format mentioned above) in Harvest the authentication flow always complains that Safari cannot open the page because the server cannot be found. I am able to open the app manually with the appname:// URL from the
It sounds like you're looking for the URL to use regarding redirection from a web call. I'm not certain on oath2, but on SAML it is something like
https://where you are signing in/SSOpage?RelayState=https://where you are going
I hope this helps get you to your answer.
If anyone else has this issue, the identifier and URL Schemes should not be com.example.myapp and MyApp, respectively. You only need to set the URL Scheme to com.example.myapp

Testing Google OAuth 2.0 with localhost?

How do I test the Google OAuth 2.0 on my app with localhost, since Google requires a top private domain as the authorized domain?
I tried to look up solutions, but all the solutions given have been a while ago, and I think Google has changed their service since then.
localhost is not a valid top-level domain, and it won't let you generate credentials without setting up a consent screen. You can add more than one authorized domain if you'd like, but you can't leave it empty. But you CAN delete the field if you have no domains / would not like to add domains for now. you just can't LEAVE it empty.
Notice the description -- "When a domain is used". so it's not an obligation to add authorized domain for consent screen. Moreover, the authorized domain here is only related with consent screen. Authorized origins and Authorized redirect URLs needs to be specified in the credentials part, which is all that matters; specifying the origin from which requests will be accepted and where it will be redirected. So just omit the authorized domain in the consent screen.
So how to delete it? Just in case if you haven't noticed, just hover over the field and this little man will pop up. delete it. that's all. Now you should be able to save and continue, where it might ask you to setup scopes.
I know it's really late, hoping it might help others..
After about an hour banging my head against the wall I found this article that has a step by step solution that works (as of July 2020).
Basically you need to create a service account, share the sheet with that account, and then it should work.
All of the other auth methods I tried either raised nonsense errors, or simply silently didn't work.
The list of authorized domains is required before you submit a request for app verification. If you want to configure a localhost redirect URI, that is configurable in your web OAuth client ID configuration.
In case anyone has struck out on the suggestions above, this answer did the trick for me. Set my authorized JavaScript origins URI to http://localhost:8080 in the google API console then emptied my Chrome cache.
Just add an OAuth-consent-screen from here without a domain or valid domain that's up to you, after that create Credentials from here, then select OAuth client ID and enter your from here you can add javascript origin url and there you go you've done.
You add your final domain for when you are ready to become verified. Until then you will generate an OAuth client ID and enable https://localhost:3000 in "Authorized JavaScript origins"
Simple screenshot of the field you can enter localhost
Not beautiful, but works!
I've made local website(domain) on Xampp like test1.com, added that domain in Authorized domains and started Chrome from separate shortcut with parameter --ignore-certificate-errors
Note, that when you start with this flag, Chrome must not be running!
It cause Chrome to open web site in the xampp\htdocs folder and I was forced to go to folder test1.git and then to public folder, where finally site opened and the url was: https://test1.com/test1.git/public
ps. Use port 80 in httpd-vhosts.conf and not 443!

error:Redirect uri invalid for vimeo using oath in ios app

In my app I'm integrating OAuth2.0 library for vimeo upload. I'm getting error as invalid redirect uri after user log into his account.
My code,
self.oauthClient = [[LROAuth2Client alloc] initWithClientID:#"**** client ID ****"
secret:#" * secret * " redirectURL:[NSURL URLWithString:#"testMyApp://oauth"]];
In the plist i have given "testMyApp" as string in url schemes.
is this the right way to specify redirect uri? please help!
Your redirect url must 100% match the url configured on the developer site.
If your user is redirected to testMyApp://oauth your configured redirect url must be exactly testMyApp://oauth
The 3 pieces of information that you pass back to the Vimeo API (redirect_uri, code, grant_type) must be form URL encoded body parameters.
If they're being passed as query parameters, for example, the request will fail and return the error you're seeing.
For the Vimeo API to allow for your redirect, you have to register it for your app with the developer site. When it is registered there you are able to use it when you specify the redirect.
The plist scheme registration only notifies iOS that you can handle the scheme; Vimeo is unaware that it's a valid thing to redirect to for your app without this step.
The redirect url in the developer site must exactly match with the one in your application authentication request. I faced the same problem because of difference in the redirect url. But I fixed that and its working.
Developer site redirect url:
My app's request url:
https://api.vimeo.com/oauth/authorize?redirect_uri=vimeo608e5e6ffab5f7d2b567443f57684fdae8f8cb1c://auth&response_type=code&state=aee5252c-963c-4146-8358-a423326dd03c&scope=private%20public%20create%20edit%20delete%20interact&client_id=608e5e6ffab5f7d2b557443f57684fdae8f8cb1c
the value of the key redirect_url in above request is exact to the developer site. Please feel free to comment..
In my case, I had forgotten to enable implicit authentication and was getting the missing redirect_uri message.

Adding a redirect-uri to a Dropbox application

I have a working Dropbox application, using oauth. I am extending the application and have added a new redirect-uri in the App Console. I am absolutely sure that the redirect uri is correct, but I am getting a 400 Invalid redirect-uri error. My uri begins with https:// as required.
Is there a delay before new redirect uris take effect?
This is the error:
More details for developers
Invalid redirect_uri: u'https://shareddom.ws/mse/auth/guest_portal.php'. It must exactly match one of the redirect URIs you've pre-configured for your app (including the path)
This the uri, cut and pasted from the App Console:
https://shareddom.ws/mse/auth/guest_portal.php
I don't think there should be any delay at all (certainly no more than a few seconds at most).
Those two strings appear to be identical, so my guess would be that the redirect URI isn't in the right place (or maybe under the right app?). Double check that the app key you're using matches the app key you're looking at in the App Console and that redirect URI is under the "OAuth 2 Redirect URIs" section of the page.
If you're still having trouble, I'd suggest opening a support ticket so we can double check the app details for you: https://www.dropbox.com/developers/contact.

Resources