discourse.go 474 B

1234567891011121314151617181920212223
  1. package discourse
  2. import "github.com/google/uuid"
  3. type SsoConfig struct {
  4. Endpoint string
  5. ReturnEndpoint string
  6. Secret string
  7. Uuid uuid.UUID
  8. }
  9. func GetSSORequestURL(config SsoConfig) string {
  10. url := generateSSORequestURL(config)
  11. return url
  12. }
  13. // ValidateSsoResponse - Validate the signature on the sso response
  14. func ValidateSsoResponse(sso, sig, secret string) bool {
  15. ssoDataSig := computeHmac256(sso, secret)
  16. return sig == ssoDataSig
  17. }