Getting error "email already in use" while requesting for authorization code in sageone API - api

I am trying to get access token for granting my sageone api request but before that I need to get the authorization code. But when I am trying to get one I got an error on my callback url that "email is already in use"
here is the request url
`https://www.sageone.com/oauth2/auth/central?filter=apiv3.1&client_id={{MY_CLIENT_ID}}&response_type=code&redirect_uri=http://localhost:85/test.php&scope=full_access&state=1234`
After visit above link I prompted to login to my sage account when I logged in then I redirected to the callback url which I provided in the above request and got below errors in parameters
http://localhost:85/test.php?error=Invalid+request&reason=Email+already+in+use&state=1234
any can body can suggest anything here

Email already in use usually happens in a situation, where you have logged into the Sage One/Accounting application in the browser for a different country in the past. There is a valid cookie for the user, but the application looks for the user in the wrong country.
Use this URL to reset the cookie: https://www.sageone.com/?clear. Call it before you go to https://www.sageone.com/oauth2/auth/central and this should be fixed.
Note: for more documentation about this behaviour, check out the FAQs: https://developer.sage.com/api/accounting/guides/faq/.

Related

In gmail authorization, as per google doc how code can be generated by redirect url?

As per Google doc:
Handling authorization requests
When a user loads your application for the first time, they are presented with a dialog to grant permission for your application to access their Gmail account with the requested permission scopes. After this initial authorization, the user is only presented with the permission dialog if your app's client ID changes or the requested scopes have changed.
Authenticate the user
This initial sign-in returns an authorization result object that contains an authorization code if successful.
But could not get how handling authorization flow can occur? Is there an endpoint for it?
I got an answer,
request on:
https://accounts.google.com/o/oauth2/auth?client_id=*****.apps.googleusercontent.com&redirect_uri=https://www.msn.com&scope=https://mail.google.com/&response_type=code&access_type=offline&prompt=consent
Here, make sure you have specified scope in consent screen.
It will redirect user to give access of gmail scopes after that you will be redirected to msn url. url itself contains code which will be further used to get access token. code you get will be used one time only.

eBay Developer Sandbox Auth Token

I have an issue with generating a sandbox auth token, I get redirected the following link:
https://signin.ebay.com/ws/eBayISAPI.dll?ThirdPartyAuthSucessFailure&ebaytkn=&tknexp=1970-01-01+00%3A00%3A00&username=testuser_jdawg)
once the request grant the application permission.
Which states the following message:
Thank YouHelp
Authorization cancelled
It's now safe to close the browser window/tab.
Has anyone else had this issue?
The ebay URL redirect after authentication is somewhat broken.
The default URL redirects are:
On Success: https://signin.ebay.com/ws/eBayISAPI.dll?ThirdPartyAuthSucessFailure&isAuthSuccessful=true
On Failure: https://signin.ebay.com/ws/eBayISAPI.dll?ThirdPartyAuthSucessFailure&isAuthSuccessful=false
You can also define your own URLs on the Auth tokens for eBay page of the developer site.
The problem is that ebay truncates any url you enter at the first ampersand (&) encountered. This breaks their own accept URL which ends with &isAuthSuccessful=true
To fix this all you have to do is encode the ampersand as %26. So you need to change their URLs to:
On Success: https://signin.ebay.com/ws/eBayISAPI.dll?ThirdPartyAuthSucessFailure%26isAuthSuccessful=true
On Failure: https://signin.ebay.com/ws/eBayISAPI.dll?ThirdPartyAuthSucessFailure%26isAuthSuccessful=false
Edit: As you noted, this does not affect whether or not the authorization is actually successful or not, just the message that the user sees. You can also apply this solution to your own URLs too if you don't want to use theirs.

Gmail label request fails with http 403 (forbidden)

I have an application that uses OAuth 2 to access Gmail. This is working fine for most users. For some users, however, my application fails at the point of trying to read the Gmail labels, with http error 403 (forbidden). Keep in mind that previous to this API call, I have accessed the user profile successfully. Here is the call that fails:
GET /gmail/v1/users/user.name#domain.com/labels?access_token=ya29.fwI_zL1rF3xOIQcHNzpBhmjVlJhRpofkh4a9mVvwhYRo6H09qX5RNKv76zKT7e6-sEZr
I am requesting the following scopes when getting the access token, and the user has logged in to Google and accepted the request for access (and I can see this when we look at his security dashboard):
https://www.googleapis.com/auth/calendar
https://www.googleapis.com/auth/userinfo.profile
https://www.google.com/m8/feeds
https://www.googleapis.com/auth/tasks
https://www.googleapis.com/auth/gmail.labels
https://mail.google.com/
Note that I just added the gmail.labels scope in at attempt to fix this.
Again, this code is working fine for most users - why do some users fail the label request?
Use the shorthand value me instead of user.name#domain.com and the user who the access token belongs to will be used automatically.

Instragram - Redirect URI dose not match with registered - Objective C

I am getting error while Login with oAuth for Instagram, it says the redirectURI is wrong. I have researched on it and I have checked many answers on stackoverflow but its not helpful for me.
Here is the complete detail of what I did in my application.
1) I set my ClientId in pList for redirect URI :
2) I have added ig and authorize while creating the URI:
3)Now, I set ClientID in Instragram API :
And Here is my RedirectURI :
https://instagram.com/oauth/authorize?response_type=token&redirect_uri=igdd5fb08a33444af0b2b9c9420e69bc35%3A%2F%2Fauthorize&scope=relationships&client_id=dd5fb08a33444af0b2b9c9420e69bc35
When I fire the URl after login, it gives me the following error:
Can anyone help to find out where I am going wrong ?
Thanks,
The redirect URI you're providing is not what you have defined in your client settings.
1) Go to http://instagram.com/developer/clients/manage/
2) For your desired client/application, look for REDIRECT URI.
3) Make sure you provide the same redirect uri in your request as it is defined in your client/application settings. In your case, https://api.instagram.com/oauth/authorize/?response_type=token&redirect_uri=REDIRECT-URI&client_id=CLIENT-ID
Note: You may provide an optional scope parameter to request additional permissions outside of the “basic” permissions scope.
Note: You may provide an optional state parameter to carry through any server-specific state you need to, for example, protect against CSRF issues.
At this point, we present the user with a login screen and then a confirmation screen where they approve your app’s access to his/her Instagram data.
4) Once a user successfully authenticates and authorizes your application, instagram will redirect the user to your redirect_uri with a code parameter that you’ll use to request the access_token like http://your-redirect-uri?code=CODE.
For more information to learn about authentication process [Link]
tl;dr. The Redirect URI you send to /authorized must be same as the registered URI in your app.

authenticated referral not working but oauth url works

I have two methods of authenticating users. One is the normal oauth way from my website:
https://www.facebook.com/dialog/oauth?client_id=161077997258367&redirect_uri=http%3A%2F%2Fwww.shopography.com%2F&scope=email%2Coffline_access%2Cuser_birthday%2Cpublish_actions%2Cpublish_stream%2Cread_stream%2Cstatus_update&state=%7B%22rID%22%3A570001%7D
This returns a code which I can then use to request an auth_token. No problems there!
However, when I click on a link internal to Facebook which is configured for authenticated referral, I get a code that Facebook rejects and therefore, I get no auth_token.
The error I get with authenticated referall is:
{"error":{"message":"Error validating verification code.","type":"OAuthException"}}
Any ideas?
Get the current URL from the authenticated referral request and use it up to the '&code=..'. as redirect_uri when exchanging access token.