You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

session.go 857B

123456789101112131415161718192021
  1. package goth
  2. // Params is used to pass data to sessions for authorization. An existing
  3. // implementation, and the one most likely to be used, is `url.Values`.
  4. type Params interface {
  5. Get(string) string
  6. }
  7. // Session needs to be implemented as part of the provider package.
  8. // It will be marshaled and persisted between requests to "tie"
  9. // the start and the end of the authorization process with a
  10. // 3rd party provider.
  11. type Session interface {
  12. // GetAuthURL returns the URL for the authentication end-point for the provider.
  13. GetAuthURL() (string, error)
  14. // Marshal generates a string representation of the Session for storing between requests.
  15. Marshal() string
  16. // Authorize should validate the data from the provider and return an access token
  17. // that can be stored for later access to the provider.
  18. Authorize(Provider, Params) (string, error)
  19. }