Ruby gem works great for us for Gmail and Yahoo. When accessing via Outlook and their new API we are getting the error below.
NOTE: This happens after we successfully receive the params[:code] and are trying to get the token. Any ideas?
{
"error":"invalid_request",
"error_description":"AADSTS90019: No tenant-identifying information found in either the request or implied by any provided credentials.\r\nTrace ID: 791c90ec-0f53-46c8-b15d-a3fe9f07bf18\r\nCorrelation ID: e7e0d207-2c99-4f88-bb6b-2ea62ec19e1d\r\nTimestamp: 2016-05-17 17:07:43Z",
"error_codes":[
90019
],
"timestamp":"2016-05-17 17:07:43Z",
"trace_id":"791c90ec-0f53-46c8-b15d-a3fe9f07bf18",
"correlation_id":"e7e0d207-2c99-4f88-bb6b-2ea62ec19e1d"
}
Solution: Need to use an account that is #outlook.com to generate your credentials.
You can't use a personal or work email address... turns out it must be an actual #outlook.com account.
Related
I want to use microsoft graph API in my application without user. For I got access token by tenant id (a8ef7dd1-217d-430f-9ba0-4dd465b9098d) using this url
https://login.microsoftonline.com/a8ef7dd1-217d-430f-9ba0-4dd465b9098d/oauth2/v2.0/token
I see correct result after this request.
Afte that I try to get user using this url
https://graph.microsoft.com/v1.0/users
It also works fine for me.
Example response: {"#odata.context":"https://graph.microsoft.com/v1.0/$metadata#users","value":[{"businessPhones":[],"displayName":"IOTA CLM","givenName":"IOTA","jobTitle":null,"mail":null,"mobilePhone":null,"officeLocation":null,"preferredLanguage":null,"surname":"CLM","userPrincipalName":"clm-iota_outlook.com#EXT##clmiotaoutlook.onmicrosoft.com","id":"50ecbaed-9cee-411f-abb6-5e53e2a1051a"}]}
But if I try to get mailFolders using next get request
https://graph.microsoft.com/v1.0/users/50ecbaed-9cee-411f-abb6-5e53e2a1051a/mailFolders
I see 404 error :
"code": "ResourceNotFound",
"message": "Resource could not be discovered."
What I missed?
Are you sure that that user has a mailbox?
Make sure you have the correct permissions? To access mail, you require Mail.Read application permissions that have been admin consented. https://learn.microsoft.com/en-us/graph/api/user-list-messages?view=graph-rest-1.0
You can admin consent where you've registered the application in the portal in the "Permissions" tab of the application. https://aad.portal.azure.com
I've had the same error.
You probably didn't assign a license while adding users at https://admin.microsoft.com
If you go to the Microsoft site, you will find that you need to license Exchange Online to use the Exchange Online feature.
https://learn.microsoft.com/en-us/exchange/exchange-online
Check it out!
I am working on an Angular 7 application that uses GraphAPI. I am trying to create an online meeting from this application.
Each time I send a POST request I get 'Forbidden' as response. I have used apis's with Delegated permission before and it works.
Since online meeting requires 'Application Permission' I am not sure where to specify it. Could anyone help me with this?
You specify the permissions in App Registration > your app > settings.
You have a problem with the way you are trying to access the token. I used to get the same error however, got resolved by passing userName and Password as well in the auth request and using grant_type as password.
I am trying to add email contact to my SendGrid Account List, but am unable to authenticate from the iOS App. I have tried authentication from https://sendgrid.com/docs/API_Reference/Web_API_v3/How_To_Use_The_Web_API_v3/authentication.html but getting 404 NOT Found Error. To add contact to a list, I need to hit https://sendgrid.com/docs/API_Reference/Web_API_v3/Marketing_Campaigns/contactdb.html#Add-a-Single-Recipient-to-a-List-POST API referenced here, but its returning "Authentication Required".
Got it. Answer to my question is SendGrid API v3 Documentation i.e. https://sendgrid.com/docs/API_Reference/api_v3.html. Need to send the API key in request headers.
I am trying to utilize the google_drive gem in a Rails app and am getting the following error:
"Authentication failed for [my_email_address]#gmail.com: Response code 403 for post https://www.google.com/accounts/ClientLogin: Error=BadAuthentication Info=InvalidSecondFactor"
Google is preventing access (I keep getting security warnings via email from Google: "Google Account: sign-in attempt blocked"), and am looking for a way to get around this error.
Someone suggested I enabled two-step verification in my gmail account to ultimately retrieve an "application-specific password." I entered the application-specific password in place of my normal gmail password but Google, I believe, is still denying my application access to my gmail account.
Any idea how to get around this?
Solution...
Disable two-step verification.
Go here: https://www.google.com/settings/security/lesssecureapps
Enable "Less secure apps"
Run app again with usual password.
I want to get PayPal reports and for this reason I installed paypal-report gem.
Can someone look are my credentials are correct or for Reporting API usage I need some special account ?
I have verified bussiness account.
Here is my code:
require 'paypal/report'
api = Paypal::Report.new("my secure account MerchantID", "mypassword", "my secure account MerchantID", "PayPalUK")
puts api.daily.inspect
I also tried to enter my email instead of MerchanID, but it didn't work.
and this gives me error:
C:/Ruby193/lib/ruby/gems/1.9.1/gems/paypal-report-0.1.2/lib/paypal/report.rb:141
:in `block in request': Invalid merchant account (RuntimeError)
I tried to inspect api value, by using puts api and here is result:
puts api
//and result:
#<Paypal::Report:0x27a4310>
Can someone help me ?
Seeing 'PayPalUK' in there, I've got a suspicion the gem you're using is for PayPal Payflow services (and when it comes to reporting, that would be XML Reporting).
Seeing as you mention having a regular 'verified business account', I don't think you'd have access to Payflow API calls. Thus, no correct credentials to enter there.
What PayPal API call are you trying to use? Is it TransactionSearch you're looking for?
If so, try the ruby-paypal gem.
(Note, I haven't tested it, but it's the first one a quick Google search for "PayPal TransactionSearch gem" returned.)