Documentation ¶
Index ¶
Constants ¶
View Source
const (
STATE_COOKIE = "oauth_state"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides endpoints to allow this agent to be authorized.
func NewService ¶
func (*Service) PostAuth ¶
func (s *Service) PostAuth(w http.ResponseWriter, r *http.Request)
PostAuth is the landing page where the user lads after authorizing. As above, you can do anything you want here. A common thing you might do is get the user information and then perform some sort of account linking in your database.
func (*Service) PreAuth ¶
func (s *Service) PreAuth(w http.ResponseWriter, r *http.Request)
PreAuth is the landing page that the user arrives at when they first attempt to use the agent while unauthorized. You can do anything you want here, including making sure the user has an account on your side. At some point, you'll probably want to make a call to the authorize endpoint to authorize the app.
Click to show internal directories.
Click to hide internal directories.