Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

togo-framework/auth-saml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

1 Commit

Repository files navigation

togo

togo-framework/auth-saml

marketplace pkg.go.dev MIT

SAML 2.0 SSO (service-provider) for the togo auth family — enterprise login via Okta, Azure AD, OneLogin, etc.

Install

togo install togo-framework/auth-saml

Adds SAML 2.0 service-provider login to togo. It configures a SAML SP from env, exposes the standard SP endpoints, and on a verified IdP assertion finds-or-creates the user by the asserted email and issues an auth session via the auth plugin. When unconfigured it registers cleanly and its endpoints return 501 (no crash).

Configuration

Env Description
SAML_ROOT_URL the app's external base URL, e.g. https://app.example.com
SAML_SP_CERT the SP's X.509 certificate (PEM)
SAML_SP_KEY the SP's RSA private key (PEM)
SAML_IDP_METADATA_URL the IdP metadata URL (or use SAML_IDP_METADATA_XML)
SAML_IDP_METADATA_XML the IdP metadata XML inline (alternative to the URL)
SAML_RETURN_URL post-login redirect (default /)

Generate an SP keypair:

openssl req -x509 -newkey rsa:2048 -keyout sp.key -out sp.crt -days 3650 -nodes -subj "/CN=app.example.com"
export SAML_SP_CERT="$(cat sp.crt)" SAML_SP_KEY="$(cat sp.key)"

Register the SP with your IdP using the metadata at /api/auth/saml/metadata (Entity ID + ACS URL are derived from SAML_ROOT_URL).

Endpoints

Method Path Purpose
GET /api/auth/saml/metadata SP metadata XML (give this to the IdP)
GET /api/auth/saml/login?return=/admin SP-initiated login → redirect to the IdP
POST /api/auth/saml/acs Assertion Consumer Service → verify, issue session, redirect
GET /api/auth/saml/status { "configured": bool }

On success the ACS issues an auth session (cookie/JWT via the auth plugin) and redirects to the validated RelayState/return URL (open-redirect-safe — local paths only).


Premium sponsors

ID8 Media · One Studio

Support togo — become a sponsor.

About

togo SAML 2.0 SSO — service-provider login (metadata/login/ACS) issuing an auth session

Topics

Resources

License

Stars

Watchers

Forks

Packages

Contributors

Languages

AltStyle によって変換されたページ (->オリジナル) /