00_oauth

command
v0.0.0-...-7d6fc1f Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2019 License: MIT Imports: 10 Imported by: 0

README

Yandex OAuth 2.0 example

OAuth application registration

  1. Go to Yandex OAuth
  2. Click Register new client
  3. Make sure to choose "Web services" as a target Platform and specify proper callback URI Platforms
  4. Make sure to grant "Yandex.Disk REST API" permissions (or choose whatever you need) Permissions
  5. Click "Create app"
  6. Use "ID" and "Password" as Client ID and Client Secret for OAuth client

Usage

  1. Build & run example application
  2. Open localhost:8000/auth/yandex/login (or use whatever listen address you specified)

Building

go build -o ./bin/yandex-oauth ./examples/00_oauth/main.go

Running

./bin/yandex-oauth                                             \
    -listen=locahost:8000                                      \
    -client-id=YOUR-APPLICATION-CLIENT-ID                      \
    -client-secret=YOUR-APPLICATION-CLIENT-SECRET              \
    -callback-url="http://localhost:8000/auth/yandex/callback"

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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