example

command
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 15, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

The example program shows how to use the auth package.

Before usage, credentials needs to be created. Go to the https://console.cloud.google.com/apis/credentials page and create an "OAuth 2.0 Client ID". The OAuth 2.0 client ID and secret should be passed using the 'client-id' and 'client-secret' flags. In the client ID configuration, the "Authorized Javascript origins" should contain http://localhost:8080 (or another URL address that this server is running at). And the "Authorized redirect URIs" should contain the same address with a "/auth" suffix - according to where the `auth.RedirectHandler()` is mounted in this code, and see that `auth.Config.OAuth2.RedirectURL` is configured accordingly.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL