Skip to content

Package traqoauth2 provides constants for using OAuth2 to access traQ.

License

Notifications You must be signed in to change notification settings

traPtitech/go-traq-oauth2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-traq-oauth2

GoDoc

Package traqoauth2 provides constants for using OAuth2 to access traQ.

Usage

Warning

OAuth2 Authorization Code Flowに則ったClientを実装する前に、他のより簡単な方法で実装できないか検討してください。

Full example: _example/

package main

import (
  // ...
  traqoauth2 "github.com/traPtitech/go-traq-oauth2"
)

// Configure at https://bot-console.trap.jp/clients
var  oauth2Config = oauth2.Config{
  ClientID:     os.Getenv("TRAQ_CLIENT_ID"),
  ClientSecret: os.Getenv("TRAQ_CLIENT_SECRET"),
  Endpoint:     traqoauth2.Prod, // or traqoauth2.Staging
  RedirectURL:  os.Getenv("TRAQ_REDIRECT_URL"),
  Scopes:       []string{traqoauth2.ScopeRead, traqoauth2.ScopeWrite}
}

About

Package traqoauth2 provides constants for using OAuth2 to access traQ.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages