-
Notifications
You must be signed in to change notification settings - Fork 399
Describe social-sign-on (multiple SSO providers) #3163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7e3f72a
Describe social-sign-on (multiple SSO providers)
turt2live a9a15fe
Add changelogs
turt2live fae88b8
Move brand registry out of structured data directory
turt2live 641d2ad
Apply suggestions from code review
turt2live e6245f6
Clarify provider naming
turt2live 67b62cf
Clarify render approach
turt2live 70d9deb
Apply suggestions from code review
turt2live File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Multiple SSO providers are possible through `m.login.sso` as per [MSC2858](https://github.com/matrix-org/matrix-doc/pull/2858). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
`/login/sso/redirect/{idpId}` has been added as per [MSC2858](https://github.com/matrix-org/matrix-doc/pull/2858). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# Copyright 2021 The Matrix.org Foundation C.I.C. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
type: object | ||
title: m.login.sso flow schema | ||
properties: | ||
type: | ||
type: enum | ||
enum: ["m.login.sso"] | ||
description: The string `m.login.sso` | ||
example: "m.login.sso" | ||
identity_providers: | ||
type: array | ||
description: |- | ||
Optional identity providers (IdPs) to present to the user. These would | ||
appear (typically) as distinct buttons for the user to interact with, | ||
and would map to the appropriate IdP-dependent redirect endpoint for that | ||
IdP. | ||
example: [ | ||
{"id": "com.example.idp.github", "name": "Github", "brand": "github"}, | ||
turt2live marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{"id": "com.example.idp.gitlab", "name": "Gitlab", "icon": "mxc://example.com/abc123"}, | ||
turt2live marked this conversation as resolved.
Show resolved
Hide resolved
|
||
] | ||
items: | ||
type: object | ||
title: IdP | ||
description: An identity provider. | ||
properties: | ||
id: | ||
type: string | ||
description: |- | ||
Opaque string chosen by the homeserver, uniquely identifying | ||
the IdP from other IdPs the homeserver might support. Should | ||
be between 1 and 255 characters in length, containing unreserved | ||
characters under [RFC 3986](http://www.ietf.org/rfc/rfc3986.txt) | ||
(`ALPHA DIGIT "-" / "." / "_" / "~"`). Clients are not intended | ||
to parse or infer meaning from opaque strings. | ||
example: "com.example.idp.github" | ||
name: | ||
type: string | ||
description: |- | ||
Human readable description for the IdP, intended to be shown to | ||
the user. | ||
example: "Github" | ||
icon: | ||
type: string | ||
description: |- | ||
Optional MXC URI to provide an image/icon representing the IdP. | ||
Intended to be shown alongside the `name` if provided. | ||
example: "mxc://example.org/abc123" | ||
brand: | ||
type: string | ||
# TODO @@TR: Actually link to "common identifier format" section when it exists. | ||
description: |- | ||
Optional UI hint for what kind of common SSO provider is being | ||
described in this IdP. Matrix maintains a registry of identifiers | ||
[in the matrix-doc repo](https://github.com/matrix-org/matrix-doc/blob/master/informal/idp-brands.md) | ||
to ensure clients and servers are aligned on major/common brands. | ||
|
||
Clients should prefer the `brand` over the `icon`, when both are | ||
provided. Clients are not required to support any particular `brand`, | ||
including those in the registry, though are expected to be able to | ||
present any IdP based off the `name`/`icon` to the user regardless. | ||
|
||
Unregistered brands are permitted using the Standard Identifier Format, | ||
though excluding the namespace requirements. For example, `examplesso` | ||
is a valid brand which is not in the registry but still permitted. | ||
Servers should be mindful that clients might not support their unregistered | ||
brand usage as intended by the server. | ||
example: "github" | ||
required: ['id', 'name'] | ||
|
||
required: ['type'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# SSO IdP brand registry | ||
|
||
This informal document contains specification for common brands that clients might experience | ||
in the wild as part of `m.login.sso` flows. To add your brand, open a PR against this document | ||
with the relevant additions (using the existing specification as reference) - an MSC is not | ||
required. Once opened, mention your PR in [#sct-office:matrix.org](https://matrix.to/#/#sct-office:matrix.org) | ||
on Matrix so it doesn't end up lost. | ||
|
||
Please also take some time to read the [contributing guidelines](https://github.com/matrix-org/matrix-doc/blob/master/CONTRIBUTING.rst) | ||
for an overview of PR requirements. | ||
|
||
<!-- | ||
Author's note: This document intentionally has 2 blank lines between brands for easier distinction | ||
in the plaintext version. Please maintain them for new & existing brands. | ||
--> | ||
|
||
## Brands | ||
|
||
For the brands listed here, the `identifier` would be used as the `brand` value in an IdP definition | ||
under `m.login.sso`'s flow. | ||
|
||
Note that each brand may have their own requirements for how they are represented by clients, such as | ||
Facebook/Twitter wanting their signature blues for button backgrounds whereas GitHub is not as particular | ||
about the press requirements. Clients should not rely on this document for guidance on press requirements | ||
and instead refer to the brands individually. | ||
|
||
|
||
### Apple | ||
|
||
**Identifier**: `apple` | ||
|
||
Suitable for "Sign in with Apple": see https://developer.apple.com/design/human-interface-guidelines/sign-in-with-apple/overview/buttons/. | ||
|
||
|
||
|
||
**Identifier**: `facebook` | ||
|
||
"Continue with Facebook": see https://developers.facebook.com/docs/facebook-login/web/login-button/. | ||
|
||
|
||
### GitHub | ||
|
||
**Identifier**: `github` | ||
|
||
Logos available at https://github.com/logos. | ||
|
||
|
||
### Gitlab | ||
turt2live marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
**Identifier**: `gitlab` | ||
|
||
Logos available at https://about.gitlab.com/press/press-kit/. | ||
|
||
|
||
|
||
**Identifier**: `google` | ||
|
||
Suitable for "Google Sign-In": see https://developers.google.com/identity/branding-guidelines. | ||
|
||
|
||
|
||
**Identifier**: `twitter` | ||
|
||
Suitable for "Log in with Twitter": see https://developer.twitter.com/en/docs/authentication/guides/log-in-with-twitter#tab1. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.