|
| 1 | +# Copyright 2021 The Matrix.org Foundation C.I.C. |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | +type: object |
| 15 | +title: m.login.sso flow schema |
| 16 | +properties: |
| 17 | + type: |
| 18 | + type: enum |
| 19 | + enum: ["m.login.sso"] |
| 20 | + description: The string `m.login.sso` |
| 21 | + example: "m.login.sso" |
| 22 | + identity_providers: |
| 23 | + type: array |
| 24 | + description: |- |
| 25 | + Optional identity providers (IdPs) to present to the user. These would |
| 26 | + appear (typically) as distinct buttons for the user to interact with, |
| 27 | + and would map to the appropriate IdP-dependent redirect endpoint for that |
| 28 | + IdP. |
| 29 | + example: [ |
| 30 | + {"id": "com.example.idp.github", "name": "GitHub", "brand": "github"}, |
| 31 | + {"id": "com.example.idp.gitlab", "name": "GitLab", "icon": "mxc://example.com/abc123"}, |
| 32 | + ] |
| 33 | + items: |
| 34 | + type: object |
| 35 | + title: IdP |
| 36 | + description: An identity provider. |
| 37 | + properties: |
| 38 | + id: |
| 39 | + type: string |
| 40 | + description: |- |
| 41 | + Opaque string chosen by the homeserver, uniquely identifying |
| 42 | + the IdP from other IdPs the homeserver might support. Should |
| 43 | + be between 1 and 255 characters in length, containing unreserved |
| 44 | + characters under [RFC 3986](http://www.ietf.org/rfc/rfc3986.txt) |
| 45 | + (`ALPHA DIGIT "-" / "." / "_" / "~"`). Clients are not intended |
| 46 | + to parse or infer meaning from opaque strings. |
| 47 | + example: "com.example.idp.github" |
| 48 | + name: |
| 49 | + type: string |
| 50 | + description: |- |
| 51 | + Human readable description for the IdP, intended to be shown to |
| 52 | + the user. |
| 53 | + example: "Github" |
| 54 | + icon: |
| 55 | + type: string |
| 56 | + description: |- |
| 57 | + Optional MXC URI to provide an image/icon representing the IdP. |
| 58 | + Intended to be shown alongside the `name` if provided. |
| 59 | + example: "mxc://example.org/abc123" |
| 60 | + brand: |
| 61 | + type: string |
| 62 | + # TODO @@TR: Actually link to "common identifier format" section when it exists. |
| 63 | + description: |- |
| 64 | + Optional UI hint for what kind of common SSO provider is being |
| 65 | + described in this IdP. Matrix maintains a registry of identifiers |
| 66 | + [in the matrix-doc repo](https://github.com/matrix-org/matrix-doc/blob/master/informal/idp-brands.md) |
| 67 | + to ensure clients and servers are aligned on major/common brands. |
| 68 | +
|
| 69 | + Clients should prefer the `brand` over the `icon`, when both are |
| 70 | + provided. Clients are not required to support any particular `brand`, |
| 71 | + including those in the registry, though are expected to be able to |
| 72 | + present any IdP based off the `name`/`icon` to the user regardless. |
| 73 | +
|
| 74 | + Unregistered brands are permitted using the Standard Identifier Format, |
| 75 | + though excluding the namespace requirements. For example, `examplesso` |
| 76 | + is a valid brand which is not in the registry but still permitted. |
| 77 | + Servers should be mindful that clients might not support their unregistered |
| 78 | + brand usage as intended by the server. |
| 79 | + example: "github" |
| 80 | + required: ['id', 'name'] |
| 81 | + |
| 82 | +required: ['type'] |
0 commit comments