Difference between authenticate in browser vs not in Postman? - api

I not hugely experienced with API's, but I was wondering the difference in Postman with using the 'Authorize using Browser' below Callback URL and not using it. (I'm trying to connect to Microsoft Dataverse using Web API) When I don't use it a pop up comes up fine and I can sign in and authentication goes great. But if I use the browser it won't work. Now, I don't have Azure Admin rights to set up callback URL's in my environment so I imagine that is part of the issue, I'm just wondering why it works one way and not the other. I was trying to replicate in python and am getting the same error as trying to use browser in postman. I would like to understand what backend process Postman is using in the non-browser version so I can replicate if possible. I followed Microsoft's example in the link below as well.
Postman Example
https://learn.microsoft.com/en-us/learn/modules/common-data-service-web-api/3-postman?ns-enrollment-type=learningpath&ns-enrollment-id=learn-dynamics.integrate-power-platform

Related

Why can't I connect to my bot framework using the end point API

Hello I'm currently trying to set up the bot framework from Microsoft, so I can call this from my REST API.
I created the bot framework using the portal from Microsoft and integrated LUIS into it. This part is not the problem, but when I try to call the end API I get 401 unauthorized with the message "BotAuthenticator failed to authenticate incoming request!". I tried this in Postman and CURL and both give the same response.
I've been searching on the web and saw that you need to pass a bearer token in the header. For this I used the login services from Microsoft and successfully got a token from it.
Even with this token in the header I keep getting the same response. I also tried using the bot emulator from Microsoft with the same Microsoft ID and Password, but here it seems to work.
Am I forgetting something important or do I have to change some settings in order to make this work outside the bot emulator?
You usually talk to your bot through one of the available channels and not directly to the bot implementation. If you want to talk to your bot through a REST API, you would need to use the Direct Line API. Did you enable the Direct Line Channel? Please have a look at the samples here - https://learn.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-direct-line-3-0-concepts

Quickblox sdk - Authentication token is required error (xamarin.forms)

I am trying to run quickblox sample chat application which I got from following link
https://github.com/QuickBlox/quickblox-dotnet-sdk
Issue here is, when I run the app, it fails to load base session and gives error such as "{"errors":["Token is required"]}". I tried to debug it but could not find the root cause of it.
(Example code is using Quickblox sdk 1.2.2, which I tried to upgrade to 1.2.7 as well but in that case also still that issue remains)
The method inside sdk uses service call to api (http://api.quickblox.com/session.json) for getting session, which I tried to call by using Postman (google chrome extension), in which case I was able to get the session in response. Strange it is.
Does anybody know what is wrong with the example?
Update: I tried to manually write http call for getting session. Now in this case, I am no more able to access dialogs and other api calls are also failing(getting forbidden error in almost all sdk api calls after authenticating).
Could anybody tell me what is going wrong here?
After spending complete day found the fix. It was really small issue. Currently sample in github is using http://api.quickblox.comas a api end point, change it to https://api.quickblox.comand it will start working. Note the 's' in url.
The best way to do this is by using the account settings API.

Logging Analytics API

I wrote an application that downloads data from Analytics API. I didn’t have problem with login I used the OAuth 2.0 on my first computer, the problem is that now I’ve changed to my laptop, the authentication doesn’t work correctly.
The program use the next url for obtain the authentication:
https://accounts.google.com/o/oauth2/auth?client_id=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com&redirect_uri=http://localhost:53636/Callback&response_type=code&scope=https://www.googleapis.com/auth/analytics.readonly
If I put this url in the old laptop the login works, but If I use the same url for login in the new laptop only obtain a access without connection.
I don’t understand why I get different results depends on the computer.

Dropbox - any API to cli_link?

I'm using the dropboxd service under Linux, which requires you to log into their website e.g. https://www.dropbox.com/cli_link?host_id=2173bf325f94beee3b1879d2c7b49e69 to link the machine to your account.
Is there any programatic way to do this (ideally using Java)? To access the website above it seems you need to login using forms (which seems tricky to do programatically), and their basic REST API (https://www.dropbox.com/developers/core/docs) doesnt seem to cover the cli_link command.
I could write an app to do the sync using their full API, but it seems like overkill since aside from the cli_link requirement the basic dropboxd does all that I need.
The official Dropbox desktop client is unrelated to the API, though both the API and the Linux CLI require user interaction on the Dropbox web site (once per link) to authorize the linking. Also, note that automating/scraping the site itself is not allowed by the terms:
https://www.dropbox.com/terms#acceptable_use
Not really a solution for DropBox users, but in the end we just moved over to use MediaFire instead. That has a full REST API and doesnt require any manual intervention.

Google Plus API - Retrieve code programmatically

I'm using Java with Google Plus API. I'm using OAuth 2.0. When a user is authenticated, an access code is returned in a browser. Now, given that the code must accompany a call to the Google Plus API, I currently have to manually copy the code and use it in making calls to the Google Plus API. What I wish to do, however, is to programmatically retrieve this code; eliminate the manual copying.
Any assistance will be highly appreciated. Thanks in advance.
It sounds like you're writing a command line or some other non-web application that uses the Google+ API. This throws a little bit of a wrench into the token delivery via HTTP redirect. Without the redirect there's no way for the OAuth web pages to communicate with your code and hence you must copy and paste it.
There is one work around that seems to work pretty well. You can set up a local web server, such as an embedded Jetty, and complete the OAuth flow by redirecting the user back to their locally running web server.
You can see an example of this implemented in oacurl which is hosted here: http://code.google.com/p/oacurl/