WeChat oauth 2 doesn't work - how to fix? - oauth

I'm trying to setup Wechat oauth login.
I have verified international account ("subscription" type), but an example from documentation doesn't work for my appid
https://open.weixin.qq.com/connect/qrconnect?appid=wx13243a5b6496168e&redirect_uri=http://foo.bar/baz&response_type=code&scope=snsapi_login
Scope 参数错误或没有 Scope 权限
I guess this may be because of "subscription" type, but there were no such options during a registration process.
What should I do to enable WeChat oauth for my site?

for anyone who tries to do the OAuth with wechat in swift, you can follow this link here to start with SDK integration, then this link to integrate OAuth. i post it here because the above link you provided has expired.
the error message above basically means you didn't specify the scope of your request. the second link has it.
// Build a SendAuthReq structure
SendAuthReq* req =[[[SendAuthReq alloc]init]autorelease];
req.scope = #"snsapi_userinfo";
req.state = #"123";
// The third party sends a SendAuthReq message structure to the Weixin platform.
[WXApi sendReq:req];

Related

google action account linking Accounts failed to link

I want to account for linking google action to my web app. followed the OAuth Client Information. I have implemented
Set Up an OAuth2 Server Using Passport in Laravel( tutorial link).Where I did authentication. finally, I find my application at my home mobile app but when goes to click on MY created app it gives me account linked and after that an error "something went wrong and close" but when I open my
it gives me an error
Accounts failed to link. Please close your browser and try again
The documentation at Add authentication to your project indicates that you need to use the Authorization Code auth type instead of the Implicit flow.

Custom scheme URIs are not allowed for 'Web' client type - Google with Firebase

I am trying to implement google sign in using firebase in to my iOS app. I follow this tutorial.
https://firebase.google.com/docs/auth/ios/google-signin
I have setup the iOS app in firebase and use the google clientID and reversedClientID from the dowloaded GoogleService-Info.plist.
FYI: I have a custom sign-in button instead of the google sign in button. Anyway when i click the sign in button, google following error display in a webview.
I know my problem is the same as which described in this question.
Google 400 Error: invalid request Custom scheme URIs are not allowed for 'Web' client type
But, in my case, I have created the app in Firebase still I get the error. Any idea please...
The first step is to check if you have already the OAuth 2.0 ID for iOS. To do this please open the Credentials page in the API Console. I hope you will find iOS client for your application under OAuth 2.0 client IDs section. If not, please follow this Guide
The second step is to replace the Web Client ID with in iOS Client ID from OAuth 2.0 client IDs section. To do this, you should open the GoogleService-Info.plist and modify following keys: CLIENT_ID with [value].apps.googleusercontent.com and REVERSED_CLIENT_ID with com.googleusercontent.apps.[value].
if you're using flutterfire ui package you need to change the client id parameter in your GoogleProviderConfiguration class with the iOS client id,
you can copy it from here Credential page
example:
providerConfigs: [
GoogleProviderConfiguration(
clientId: "your copied key here"),
]
re-build you're app and you should be good to go
I've just faced this same issue using flutterfire_ui on Flutter.
The error appears to be from a couple of things. As Valeriy points out you need the ios client ID. But I still got the error if I used the scopes
openid
"https://www.googleapis.com/auth/userinfo.email",
"https://www.googleapis.com/auth/userinfo.profile",
Instead change these to
openid
email
profile
Strangely the opposite is true for Android, where the WebID and the first of the scopes should be used.
It also pays to be aware of the OAuth Content Screen..
In google cloud go to APIs & Services > OAuth consent screen > Edit.
You can add scopes here and fix any missing required fields that Firebase might not be filling out (I had 1). I believe this takes a while to propagate after a change, so give it an hour.

iOS Square Connect Merchant Authorization Issue

I'm having trouble authorizing a merchant in the Square OAuth flow and am using AFNetworking 2.0 in Objective-C. I called the method 'openURL' which brought up the Square log in page. From here I can log in as a merchant, but then it never returns to the app. Recommendations and code examples on what I need to do to get this to work would be much appreciated as I am very lost here. Thanks in advance!
OPEN URL Call
The 'openURL' call successfully redirects the user to 'https://connect.squareup.com/oauth2/authorize' with the Client ID and Redirect URL on Safari. After logging in and pressing "Allow" for the permissions, it doesn't jump back to the app. The code I tried follows:
NSString *urlString= #"https://connect.squareup.com/oauth2/authorize";
NSString *clientID = #"client_id=[CLIENT_ID]";
NSString *responseType = #"response_type=code";
NSString *fullURL = [NSString stringWithFormat:#"%#?%#&%#", urlString, clientID, responseType];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:fullURL]];
I am thinking it may have something to do with the URLSchemes and URL identifier. Should the "Redirect URL" on the Square portal be the same as the URL Scheme or the URL identifier? I tried both and it didn't work.
As an example, would the following values in my Info.plist be correct? My URL Schemes single item is "iostestapp" and my URL identifier is "com.name.iostestapp". The "Redirect URL" in the Square portal is "https://com.name.iostestapp".
Is something else besides the code I provide needed? I've been seeing a lot about handlers concerning OAuth online but don't see that in the Square docs.
It is necessary for the user to authorize your developer application to access their data via the API. In order to do so, you must guide the user through the Square provided Oauth flow. It is not sufficient to programmatically perform a GET request to this URL. You must guide the user through the oauth flow in a web browser.
You can present the Oauth flow to your users by opening a web page with the following URL: https://connect.squareup.com/oauth2/authorize?client_id=CLIENT_ID. The CLIENT_ID is the application identifier that you were provided when you registered your developer application in the Square developer portal. The developer portal is located at https://connect.squareup.com/apps. In the developer portal, you must also specify an oauth redirect_uri. After the user has authorized your application, they will be redirected to the redirect_uri that you specify with either an access token or a single use code (that can be exchanged by you for an access token.)
Also, please note that when you create an application in the developer portal, we provide you with a "personal access token" that you can use to perform API calls on behalf of your own user and test out the API.

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!

Sign in via Twitter (iOS)

I am developing an iOS app and want to implement native sign in via Twitter. I am using an example I found here that includes 2 steps, request token and access token. For the second step I use my twitter ACAccount (account.framework) and my app consumer_key and consumer_secret, and finally obtain an oath_token and oath_token_secret.
The problem is that when I try to fetch data with that token in my app API I get invalid token.
I think a step might be missing here or something. I look at every post related to sign in via Twitter and couldn't solve this...
Thanks everyone
This is the example I based my code
https://github.com/seancook/TWReverseAuthExample
I did almost everything the same, I am using ARC

Resources