LinkedIn oauth failure from Firebase functions example - firebase

I am following the directions at: https://github.com/firebase/functions-samples/tree/master/linkedin-auth. I have my function deployed along with this static page: https://quantum-episode-826.firebaseapp.com. However, when I click on the "Sign in" button I get the error: "Bummer, something went wrong. The redirect_uri does not match the registered value."
In the readme it says to:
which I believe I have done correctly:
Any next step suggestions for troubleshooting would be appreciated!

The answer came from an issue with a Google node runtime process variable. Appears that everything else was correct.

Related

"Error 404" when posting SignOutUser to Firebase

I write a code to access Firebase.
I use HTTPRequest to login, register, delete account etc.
All work well but one method - logout = SignOutUser - always returns with 404 Error, unknown URL.
Links that work with HTTPRequest:
https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyPassword?key=%s
https://www.googleapis.com/identitytoolkit/v3/relyingparty/signupNewUser?key=%s
https://www.googleapis.com/identitytoolkit/v3/relyingparty/deleteAccount?key=%s
(with proper API key added to the string, of course)
And the one that doesn't work:
https://www.googleapis.com/identitytoolkit/v3/relyingparty/signOutUser?key=%s
What can be the problem? Can it be fixed?
Is there any other way to logout a user?
I write the code in gdscript, but I tried it via web code too, same result.
Thank you in advance!

How do I resolve the Google OAuth "redirect_uri_mismatch" error?

I am failing to configure my Google OAuth for my Meteor app.
I was successful in setting it up a few weeks ago when it worked perfectly, but now all of a sudden I cant seem to correctly configure this.
I have tunneled my app via ngrok. Am going to give you a step by step illustration of the how I go towards setting this up. Kindly point out what am doing wrong and what I can do to rectify this.
I start in my terminal. I fire up the app using:
meteor --port 7000
I open up another terminal and fire up ngrok using:
./ngrok http 7000
This yields
In my Meteor.startup I add the following code:
../client/main.js
Meteor.startup(function () {
// Client startup method.
METEOR_OFFLINE_CATALOG=1;
METEOR_PROFILE=1;
Meteor.absoluteUrl.defaultOptions.rootUrl ='http://41958975.ngrok.io';
//
});
In my browser console when I type:
Meteor.absoluteUrl()
I get
I now paste the http://41958975.ngrok.io link into the browser and get this:
Clicking on the button is followed by:
Since the steps 1 to 5 have previously been done, I jump straight to steps 6, 7, and 8.
...and complete by pasting in the Client ID and the Client Secret
then clicking on the save configuration. The results is:
Now when I click on the sign in with google button: This pops up, just like its supposed to happen.
I click on one of the account options. This is when it all goes bazurk! I am redirected back to the sign in with google button (login page) with this error message showing
Looking at the terminal, I also get this error message:
I cant seem to get beyond this point.
What am I doing wrong and how can I get beyond this point?
Looking forward to your help.
You forgot to modify your ROOT_URL when you're running your app. The very first line of your last screenshot clearly shows it:
App running at: http://localhost:7000/
Setting absoluteUrl on client won't help, because it's your server who tries to obtain a token.
It uses OAuth._redirectUri() function to get redirect_uri, and there the Meteor.absoluteUrl() is used (it takes ROOT_URL from env variables, as stated in documentation).
Thus, your redirect_uri becomes http://localhost:7000/_oauth/google and that clearly mismatches with http://41958975.ngrok.io/_oauth/google (step #7).
To fix that you should start your Meteor application like this:
ROOT_URL="http://41958975.ngrok.io" meteor

Gravity Forms API always 401

I am trying to use the gravity forms rest api, https://www.gravityhelp.com/documentation/article/web-api/ but I receive a 401 error no matter what I try. I've tried using all the methods listed in the documentation and in Steven Henty's article, https://www.stevenhenty.com/gravity-forms-api/ but it doesn't seem to work.
If I am logged into a wordpress site as administrator should I not be able to use a link like:
http://mydomain/gravityformsapi/forms/
Thank you for any suggestions.
For mine case it was that I haven't clicked the update button "Web API" Tab.
Make sure you click update button , although it does show the API Key's but still you have to click update button to enable API.
I was getting the same thing due to some weirdness about the route endpoint. When calculating the signature you don't use a trailing slash on the route: forms/1.
But you do use a trailing slash in the URL (otherwise I got a 301 Moved Permanently):
http://demo.gravityforms.com/gravityformsapi/the_route/?api_key...
It looks odd to have /?api_key... but that is what works for me.
Here's the ruby example I was using with the demo credentials:
GravityFormsAPI.generate_URL(site: 'demo.gravityforms.com', route: 'forms/1', public_api_key: '5b225f8382', private_api_key: 'fc6d1bc71d2ebfc')
Hope this helps.
Sometimes i received intermittent 401 error after a lot of research i find this article
Azure DocumentDB Intermittent 401 error when querying REST API via Obj-c
If the signature contains + sign i received 401 error
Maybe that help other person
Sorry for my english writing
Based on the solution here I'm posting this answer.Imagine you have created the URL and it didn't work and you got 401. Then after a little time you realized the error that Opps! The parameters I was passing needed a bracket and you run the code again and you again got 401.
Why is that?
This is because the parameters which are apiKey, Signature and Expire time are the same and you only changed the other parameters with your GET request. However these three parameters are used to authenticate the user so that means the old signature which was generated to deny the permission will deny it again no matter what.
So to fix that I just changed the expire time from 1577922200 to 1577933200. I could've changed it to anything but the thing is I just need to give something new so that a new signature can be generated. So when I changed it started working.
OTHER POSSIBLE REASONWhile making the signature using SHA1 you use NSString *string_to_sign = [NSString stringWithFormat:#"%#:%#:%#:%#",api_key,http_method,route,expires];
as per the documentation. But in order to make CCHmac you have to pass it two things:
Key
Data
and based on the link it is created as
const char *cKey = [api_private_key cStringUsingEncoding:NSASCIIStringEncoding];
const char *cData = [string_to_sign cStringUsingEncoding:NSASCIIStringEncoding];
So what I was mistaking is that I was using API Key in cKey instead of API Private Key. So I change it as per tutorial said and it worked. Otherwise I was getting 401 not matter what I try.

Getting Access Token Data From OAuth Template of Asp.net

I'm trying to get access token of facebook client when a user logged in with asp.net's oauth template. But I couldn't acquire the access token when i tried some methods that i found on internet like;
AuthenticationResult result = OpenAuth.VerifyAuthentication("RegisterExternalLogin.aspx");
string actok = result.ExtraData["accesstoken"];
This try wasn't successfull. How can i acquire the access token?
I see noone has replied to your question even though it has been 10 days so I'll take a stab at it.
You mentioned that you are using asp.net's OAuth template. So I think you are looking at the line
AuthenticationResult result = OpenAuth.VerifyAuthentication("RegisterExternalLogin.aspx");
in the ExternalLoginCallback() action in AccountController.cs
As far as I can tell your syntax is correct. In fact also tested it out myself and it works. I guess you can try another way of accessing the same property
String myaccesstoken_value1 = result.ExtraData.Values.ToArray()[5];
That will give you the same result as result.ExtraData["accesstoken"]
If that does not work either then I would imagine that there is some problem with the authentication itself, rather than with your syntax here. I'm assuming you have VS2012 Express, so use the debugger to see what values are present in your variable 'result'. If it is empty, then it would indicate why you second statement errors out, and it would also indicate that there is a problem in the code before you get to this point.
Also keep in mind during testing that when you log into your app using OAuth providers such as Facebook, even when you log out of the website you continue to remain logged into facebook. You actually have to go to facebook.com and click logout there also (unless you write some additional code in your asp.net app to do a remote logout). I don't know if this applies to your situation, just giving you a heads up.
Please vote if this helps.

DotNetOpenAuth get email

I am running dotnetopenauth 3.3.0.9283 (nightly build), it works great and it solved my previous problem ( DotNetOpenAuth get email and redirect problem )
So now I am able to get the users email from gmail only! I have tried yahoo and myspace but i always get "Object reference not set to an instance of an object." I ran the sample that came with the build, ajaxlogin.aspx and loginProgrammatic.aspx they both give me the same error message.
this is the only line i added to the sample (and also set email to required)
var email = OpenIdAjaxTextBox1.AuthenticationResponse.GetExtension<ClaimsResponse>().Email;
You've got too much code on one line.
GetExtension<T>() will return null if the Provider doesn't actually include that extension in the response. So you must always check that it returns a non-null value before dereferencing it.
You're getting null back from Yahoo because they don't support giving away their users' extra information (yet) except for a small whitelist of RPs.
I don't know about MySpace, but I suspect they just don't support it either.

Resources