Hi I am new to node js server application, and just wnat to know if chrome.desktopcapture.choosedesktopmedia can only be used in chrome extention?
I am trying to make this work as a server page hosted on node js.
Note: This works when used inside chrome exteiontion but the same code used when hosted on server gives error: Uncaught TypeError: Cannot read property 'chooseDesktopMedia' of undefined
Yes, chrome.* APIs can only be used in extensions (extensions API) or apps (apps API).
The reason is that the API can be used to access private data and can do a lot of damage if used malevolently, so an explicit user consent is required to install an extension or app.
You can suggest the users to install an extension/app for your site using inline installation.
Related
I am using Python to directly run a script of automatically replying user's comments.
I have a client secrets file after applying for a web-application. However, when I run for credentials, it first asks me to Please visit this URL to authorize this application and then when I clicked on it, it gives me this error:
Error 400: redirect_uri_mismatch The redirect URI in the request, urn:ietf:wg:oauth:2.0:oob, can only be used by a Client ID for native application. It is not allowed for the WEB client type. You can create a Client ID for native application at.
What application should I have applied for the OAuth in this case.
I know that this issue could be related to redirect URL. But because I am running this out of my script on my local computer, I am wondering what my URL should be.
You have to acknowledge that your issue above is precisely due to the redirect URI mismatch. The error response you got from the API is indicating you this.
To fix you issue, you'll have to have the same redirect URI set on your project within Google developers console and, at the same time, within your Python script.
If you indeed are running your application on your desktop (laptop) computer, then follow on the error message advice: within Google developers console, do set your project type to be of Desktop kind.
I'm trying to use the Assistant2 APIs inside my Web Application (Angular CLI project) with the ibm-watson library and the suggested Webpack Configuration.
But at runtime I get different CORS policy errors calling the Assistant2 APIs.
So it's possible to use the Assistant2 APIs via browser?? Or calls must be all made server side to avoid the CORS policy errors?
Well, Watson Assistant provides REST API that can be called from anywhere where there is access to IBM Cloud (which bacicaly means access to internet) - so from browser as well.
Now, while you can call the Watson Assistant REST API directly from the client-side browser, sometimes it might be beneficial to have a server doing the actual call as when you call the REST API from the browser then the user has access to the request and the response from the system. This means the user has access to context part of the dialog response which in some cases might not be desired (depends on the stuff that the author is storing in the context).
I have a nodejs app deployed on AppEngine with IAP enabled, so right now access to its endpoints is protected against users outside of the project's IAM and I get the "x-goog-authenticated-user-id", "x-goog-authenticated-user-email" and another jwt assertion x-goog signed header, just like it should be (as detailed here https://cloud.google.com/iap/docs/identity-howto).
In certain AppEngine environments (so far Python, Java, Go) it seems you are able to use some already provided libraries to get more information about the user with Users API, however the nodejs page is disabled (here https://cloud.google.com/appengine/docs/standard/python/users/), there seems to be no indication of what should be done there. Any ideas?
If there is no straight forward way around it would I be able to have an app engine environment that also exposes for example the Python libraries for Users API so that I can wrap around them and use them in my nodejs app?
The Users API isn't supported for Node.js. Instead, you can get the identity from the x-goog-iap-jwt-assertion header.
We don't currently have a code sample for Node.js, though this looks like one reasonable approach. (Disclaimer: I'm not a Node user, and don't know enough about Node JWT libraries to endorse any of them in particular.)
Update for the current state:
There is currently a
Identity-Aware Proxy Documentation for Node JS.
I have successfully created a Native Client app that works using localhost and works once posted to the Chrome App Store.
I now need to find a way to embed this app in a web page outside of the App Store, which currently fails.
I've read that the usage of the nacl_io and specifically sockets is ONLY accessible when published via the Chrome App Store?
I also came across this https://developer.chrome.com/extensions/apps (I know it's essentially discontinued). Is there a replacement that could work? Or is it just the Chrome App Store?
The <embed> tag is mentioned here (https://developer.chrome.com/native-client/devguide/coding/application-structure). Am I right in saying even if we got this to load the .hmf file and communicate with the .pexe that it would still fail when using sockets due to the application not being passed through the Chrome App Store?
Any advice is welcome
Socket access is only allowed for applications in the Chrome Web Store. Similarly, Native Client applications (e.g. using a .nexe file) are also only allowed on the Chrome Web Store.
You can run a Portable Native Client (PNaCl) application on the open web, but it will not have access to the socket API.
nacl_io is still available to use. It's only the socket API that will fail if you try to use it.
You can still use the URLLoader and WebSocket APIs, though. Perhaps these will be enough for your application?
I am trying to implement a Google+ sign in option as part of a chrome extension using the one-time code flow as described here.
While making a request using the javascript Google API package a popup opens with an "origin_mismatch" error. This is obviously since I need to add my origin to the relevant Client Id on the Google API console.
My origin is : chrome-extension://<my extension id> however when trying to add that on the API console I get an error saying "Invalid URI: chrome-extension://..." which probably means this scheme is not supported.
Any idea what I can do instead?
I've faced the same problem. I think Google has changed the validation for javascript origins and doesn't allow origins from chrome-extension any more. Google gives you the Chrome Identity API instead (https://developer.chrome.com/apps/app_identity)
But there is a workaround. If you already have at least one chrome-extension://[ext_id] origin in your client ID and you have for example the older version of your extension with this extension ID, you can:
install this extension
go to C:\Users\username\AppData\Local\Google\Chrome\User Data\Default\Extensions (for windows)
find your extension there and open the manifest.json
copy the line "key":"[your_key]" and paste it into your developed manifest
and after next build you should get the extension with the same id as it was in the working one. Also it won't change any more.