mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Request all required OIDC scopes + grant_types (#154)
* Request all required OIDC scopes on auth * User real TOS and Policy URLs for OIDC * Request refresh_token grant type when registering client * Use unstable OIDC scope prefixes
This commit is contained in:
@@ -81,7 +81,7 @@ class AuthenticationServiceProxy: AuthenticationServiceProxyProtocol {
|
|||||||
let registationResponse = try await oidcService.registerClient(metadata: configuration)
|
let registationResponse = try await oidcService.registerClient(metadata: configuration)
|
||||||
let authResponse = try await oidcService.presentWebAuthentication(metadata: configuration,
|
let authResponse = try await oidcService.presentWebAuthentication(metadata: configuration,
|
||||||
clientID: registationResponse.clientID,
|
clientID: registationResponse.clientID,
|
||||||
scope: "urn:matrix:device:\(deviceID)",
|
scope: "openid urn:matrix:org.matrix.msc2967.client:api:* urn:matrix:org.matrix.msc2967.client:device:\(deviceID)",
|
||||||
userAgent: userAgent)
|
userAgent: userAgent)
|
||||||
let tokenResponse = try await oidcService.redeemCodeForTokens(authResponse: authResponse)
|
let tokenResponse = try await oidcService.redeemCodeForTokens(authResponse: authResponse)
|
||||||
|
|
||||||
|
|||||||
@@ -61,15 +61,15 @@ class OIDCService {
|
|||||||
let extraParams = [
|
let extraParams = [
|
||||||
"client_name": "ElementX iOS",
|
"client_name": "ElementX iOS",
|
||||||
"client_uri": "https://element.io",
|
"client_uri": "https://element.io",
|
||||||
"tos_uri": "https://example.com/tos",
|
"tos_uri": "https://element.io/user-terms-of-service",
|
||||||
"policy_uri": "https://example.com/policy"
|
"policy_uri": "https://element.io/privacy"
|
||||||
]
|
]
|
||||||
|
|
||||||
let nonTemplatizedRequest = OIDRegistrationRequest(
|
let nonTemplatizedRequest = OIDRegistrationRequest(
|
||||||
configuration: metadata,
|
configuration: metadata,
|
||||||
redirectURIs: [redirectURI],
|
redirectURIs: [redirectURI],
|
||||||
responseTypes: nil,
|
responseTypes: nil,
|
||||||
grantTypes: [OIDGrantTypeAuthorizationCode],
|
grantTypes: [OIDGrantTypeAuthorizationCode, OIDGrantTypeRefreshToken],
|
||||||
subjectType: nil,
|
subjectType: nil,
|
||||||
tokenEndpointAuthMethod: "none",
|
tokenEndpointAuthMethod: "none",
|
||||||
additionalParameters: extraParams
|
additionalParameters: extraParams
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
Use unstable MSC2967 values for OIDC scopes + client registration metadata updates.
|
||||||
Reference in New Issue
Block a user