A User Signed in to Their HUAWEI ID, but No Authorization Code Was Returned. What Can I Do? - huawei-mobile-services

I have integrated HUAWEI Account Kit into my app. However, after a user signed in to their HUAWEI ID, the error message Authorization code:null was displayed. Who can help me?

Check Docs .
I think maybe your HuaweiIdAuthParamsHelper.setAuthorizationCode method was not called, which means your app may not be authorized to obtain the authorization code.

Related

Google Smarthome Action account linking missing user information

my code is based on this example
https://codelabs.developers.google.com/codelabs/smarthome-washer
The OAuth process is working. But now I want to know who is the user.
Here
https://developers.google.com/assistant/identity/google-sign-in-oauth?oauth=code
is described that:
After the user gives your Action consent to access their Google profile, Google sends a request that contains a signed assertion of the Google user's identity.
But if I test the authentication I never will be ask to give access to my Google profile.
I think that I have to configure which information my app wants to have from the user. But I didn't know where to do that.
I searched a lot but I couldn't find an example which really explains how to get the user information.
Thank you for your help.
Regards Simon
The OAuth process is working. But now I want to know who is the user.
Just a note here that the samples and codelabs use a fake OAuth implementation does not implement a user sign-in flow and returns a hard-coded fake access token during account linking.
Here
https://developers.google.com/assistant/identity/google-sign-in-oauth?oauth=code
is described that:
After the user gives your Action consent to access their Google profile, Google sends a request that contains a signed assertion of the Google user's identity.
Smart home actions do not support the Google Sign-In account linking flows. You need to implement the OAuth authorization code flow in your account linking integration.
I think that I have to configure which information my app wants to have from the user. But I didn't know where to do that.
I searched a lot but I couldn't find an example which really explains how to get the user information.
This is essentially the opposite of what account linking accomplishes. The goal is not to provide user information from Google to your Action. Instead, account linking is used to authorize Google to access your user's devices by providing Google with an access token that your service considers valid for a particular user within your cloud service.
So in this case, you are the one that owns the user data. You are simply providing Google scoped access to that data for sending queries and commands to devices.

Facebook account linking, can anyone give small example code?

I'm very frustated, I can't figure out how to link accounts using the account_link button, it's making my life so hard, I posted this question before, and I thought I had understood how but I just didn't, it's driving me crazy.
Can someone please post a sample code of how to achieve this?
You get on you account linking url the GET parameters:
$token = $_GET['account_linking_token'];
$uri = $_GET['redirect_uri'];
Then you type in your credentials in the log in.
User: user
Password: pass
Click login.
You go and verify credentials, if they are correct, you link the account:
THIS IS THE SMALL BASIC EXAMPLE CODE I NEED
Then, if account linked succesfully, I redirect to the uri:
redirect($uri.'&authorization_code=myauthorizationtoken');
After this, I can retrieve PSID with the API.
Can somebody help me out please?
Check this out : Account Linking Failed
Use messaging_account_linking subscription for your Facebook developer application.
Your problem is that you do not understand what account linking really means. Account linking means that you should ask this current messenger user to login on your platform thereby linking the messenger account to the user account on your platform.
The flow is just an implementation of OAUTH 2.0. Please read it up to really understand what's going on.
Your job is to just
Redirect the user to a login screen on your part and get the user's PSID using the endpoint provided by the documentation.
Save the PSID and (optional) account linking token to the user's data model.
Generate an authorization code(this is part of the OAUTH 2 flow)
Redirect back to messenger.

Facebook Login Flow, helping understand me the need for the debug token call?

I'm doing a facebook app and I've followed the custom login flow instructions and I have a question on the last step:
1) I start by doing a call to /dialog/oauth to get a login code.
2) With the code I will request an access token, by hitting the graph.facebook.com/oauth/access_token and that's fine as well.
3) The instructions now say I should validate the code and token to make sure they are from the sources that requested them.
GET graph.facebook.com/debug_token?
input_token={token-to-inspect}
&access_token={app-token-or-admin-token}
My questions are:
What is the input_token in my scenario?
Do I need to do this in my flow? And why if yes?
If I just pass the same value(access_token) in both parameters I get a valid anwser but I don't know if this makes sense.
Thanks in advance.
This question has already been asked: how to verify facebook access token?
And: Verify Facebook Access Token for specific App
And: verification code example
It's simply a unit test to see if your code is still valid (to catch a bug early so it can't do any big damage).
If the access token is not valid, you can for example show a message to the user that there is a bug etc.

OAuth strategies for Facebook/Google services in mobile app with Rails background

I'm developing some iOS app with Rails background. I want to allow users authorizing through Facebook or Google. User mush be authorized before he will be able to make comments and estimate posts. It's my first experience of working with OAuth, then, please, check my steps for client-server architecture:
The App gets token/user_id from FB or Google
With every request (which requires authorization) to the server the
app must send user_id and token
The server checks if the token is valid
If all is good the server responds some data; if token is not valid
the server returns an exception code.
Please, tell me any advice you think is good. Thanks in advance.

How to authorize an app to access my account data when no auth popup shows (as a regular FB user, not app developer)?

This question comes from a NON-DEVELOPER. The APP is not mine, I just need it running correctly. I need to authorize this application http://www.facebook.com/apps/application.php?id=326971544008818 to access my account (otherwise it's not working properly) but it's opening directly without asking me if I wan't to authorize it or not. How do I get to the authorization popup?
Thanks much!!
The documentation on authorizing users and getting an access token is what you need.