sso.go
sso.go - Overview
-
Overview This file defines the data structures and functions related to Single Sign-On (SSO) configuration, specifically for SAML and Google OAuth. It includes configurations for setting up SSO with Google, fetching the OAuth provider, and related functionalities.
-
Detailed Documentation
SamlConfig
- Purpose: Represents the configuration needed for SAML SSO.
- Parameters:
SamlEntity
(string): The SAML entity ID.SamlIdp
(string): The SAML IdP URL.SamlCert
(string): The SAML certificate.
- Returns: None
GoogleOAuthConfig
- Purpose: Represents the configuration needed for Google OAuth.
- Parameters:
ClientID
(string): The Google OAuth client ID.ClientSecret
(string): The Google OAuth client secret.RedirectURI
(string): The Google OAuth redirect URI.
- Returns: None
googleIssuerURL
- Purpose: Defines the Google issuer URL.
- Parameters: None
- Returns: None
(*GoogleOAuthConfig).GetProvider
- Purpose: Creates and returns a
sso.OAuthCallbackProvider
for Google OAuth, configuring the OAuth flow and setting up the verifier. - Parameters:
g
(*GoogleOAuthConfig): A pointer to the GoogleOAuthConfig struct.domain
(string): The hosted domain for Google OAuth.siteUrl
(*url.URL): The base URL of the site.
- Returns:
sso.OAuthCallbackProvider
: An OAuth callback provider for Google.error
: An error if any issue occurred during the provider setup.
-
Code Examples None
-
Clarity and Accuracy The documentation reflects what is evident from the code.
-
Markdown & MDX Perfection The document is properly formatted in Markdown.
-
Edge Cases To Avoid Breaking MDX All potential MDX issues are avoided.
-
Getting Started Relevance Include in Getting Started: NO