File tree Expand file tree Collapse file tree 3 files changed +27
-9
lines changed
changelogs/application_service/newsfragments
data/api/application-service/definitions Expand file tree Collapse file tree 3 files changed +27
-9
lines changed Original file line number Diff line number Diff line change
1
+ Replace homeserver authorization approach with an `Authorization` header instead of `access_token` when talking to the application service, as per [MSC2832](https://github.com/matrix-org/matrix-spec-proposals/pull/2832).
Original file line number Diff line number Diff line change @@ -127,11 +127,27 @@ this.
127
127
128
128
#### Authorization
129
129
130
- Homeservers MUST include a query parameter named ` access_token `
131
- containing the ` hs_token ` from the application service's registration
132
- when making requests to the application service. Application services
133
- MUST verify the provided ` access_token ` matches their known ` hs_token ` ,
134
- failing the request with an ` M_FORBIDDEN ` error if it does not match.
130
+ {{% changed-in v="1.4" %}}
131
+
132
+ Homeservers MUST include an ` Authorization ` header, containing the ` hs_token `
133
+ from the application service's registration, when making requests to the
134
+ application service. Application services MUST verify that the provided
135
+ ` Bearer ` token matches their known ` hs_token ` , failing the request with
136
+ an ` M_FORBIDDEN ` error if it does not match.
137
+
138
+ The format of the ` Authorization ` header is similar to the [ Client-Server API] ( /client-server-api/#client-authentication ) :
139
+ ` Bearer TheHSTokenGoesHere ` .
140
+
141
+ {{% boxes/note %}}
142
+ In previous versions of this specification, an ` access_token ` query
143
+ parameter was used instead. Servers should only send this query parameter
144
+ if supporting legacy versions of the specification.
145
+
146
+ If sending the ` query_string ` , it is encouraged to send it alongside
147
+ the ` Authorization ` header for maximum compatibility.
148
+
149
+ Application services should ensure both match if both are provided.
150
+ {{% /boxes/note %}}
135
151
136
152
#### Legacy routes
137
153
Original file line number Diff line number Diff line change 1
1
# Copyright 2018 New Vector Ltd
2
+ # Copyright 2022 The Matrix.org Foundation C.I.C.
2
3
#
3
4
# Licensed under the Apache License, Version 2.0 (the "License");
4
5
# you may not use this file except in compliance with the License.
12
13
# See the License for the specific language governing permissions and
13
14
# limitations under the License.
14
15
homeserverAccessToken :
15
- type : apiKey
16
- description : The `hs_token` provided by the application service's registration.
17
- name : access_token
18
- in : query
16
+ type : http
17
+ scheme : Bearer
18
+ # Per docs, this is basically a description. https://swagger.io/docs/specification/authentication/bearer-authentication/
19
+ bearerFormat : The `hs_token` provided by the application service's registration.
You can’t perform that action at this time.
0 commit comments