How to use Google OAuth with Deno js?
Asked Answered
G

3

8

Is there some libraries or modules for Google OAuth in Deno.js? I am trying to impelemnt google login on my web application and use this google account for uploading youtube videos in deno.js.

I am grateful for any help!

Greenroom answered 10/7, 2020 at 11:5 Comment(0)
M
1

I think a generic solution for OAuth doesn't exist yet. However, if you can override the default implementation, you can try authlete_deno_fen_oauth_server third party module.

There is a generic oauth2 module but not available at the moment.

If the above option doesn't work, try using an npm module in deno as described in this stackoverflow thread and follow this medium article to achieve your goal.

Magpie answered 12/7, 2020 at 10:37 Comment(0)
C
1

Have a look at youtube-deno. I haven't used it myself, but it seems like it provides a good interface for communicating with the Youtube API with deno.


Here's an example from the readme:

// A simple example to call the search_list() function and log the response json.
import { YouTube } from "https://x.nest.land/[email protected]/mod.ts";

let obj = new YouTube("your-api-key-here", false);

obj.search_list({part: "snippet", q: "the coding train"}).then(function(response){
 console.log(response);
});
Caldarium answered 10/7, 2020 at 17:33 Comment(0)
M
1

I think a generic solution for OAuth doesn't exist yet. However, if you can override the default implementation, you can try authlete_deno_fen_oauth_server third party module.

There is a generic oauth2 module but not available at the moment.

If the above option doesn't work, try using an npm module in deno as described in this stackoverflow thread and follow this medium article to achieve your goal.

Magpie answered 12/7, 2020 at 10:37 Comment(0)
K
0

The module deno-oauth2-client works well, it's small and easy to use.

Another library, Dashport, aims to be like Passport.js for Deno. I had a bit of trouble with their example code, so I put a fork of Dashport here with a few fixes and some example code.

I put together a couple of examples for these OAuth2 libraries in Deno:

Kindergarten answered 9/3, 2021 at 22:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.