element-hq / element-hq/element-ios

SSO doesn't work

Open
#6,836 9 comments 0 reactions 0 assignees View on GitHub
S-Minor T-Defect
Dominant language
Swift
Stars
1.8k
Forks
544
PR merge metrics
PR metrics pending

Description

### Steps to reproduce

_Disclaimer: I'm not a specialist and don't know exactly how Matrix (Synapse) talks with the Element Client, so there's a possibility of a noob question below._

### **1. Where are you starting? What can you see?**
I have a YunoHost server, running Synapse. Login with user/password is disabled in the configs, and only is possible to login using SSO.

With Element Android, when you click to login with SSO, Element opens up a web page with **YunoHost's SSOwat**, asking for the username and password, and after the authentication, it works perfectly.

With Element iOS, the login with SSO doesn't even show up, and it throws this error:
![image](https://user-images.githubusercontent.com/34517016/194779449-27baf86f-bc01-43f6-ab5e-0cee7df5586b.png)

I'm not sure if this is pertinent, but this is the URL that is opening up when the SSO loads (on iOS):
`https://invaliddomain.tld/_matrix/client/r0/login/sso/redirect/?redirectUrl=element://connect?transaction_id%3Dm56[CENSORED]`
_I've added the [CENSORED] tag because I'm not sure if that thing is an auth token or something like that._

### **2. What do you click?**
"Login with SSO" button after setting Element to use my homeserver.

### Outcome

#### What did you expect?
I expected Element to login after YunoHost's SSO authentication.

#### What happened instead?
An error showed up.

### Your phone model

iPhone 13 Pro Max

### Operating system version

iOS 16.0.2

### Application version

Element version 1.9.7

### Homeserver

Synapse 1.67.0 Stable

### Will you send logs?

No

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the “Login with SSO” flow on Element iOS 1.9.7 against Synapse 1.67.0 with YunoHost SSOwat, then inspect the /_matrix/client/r0/login/sso/redirect/ entry point and its element://connect redirect. Compare the iOS behavior with the working Element Android flow; done means iOS completes authentication and logs in without the reported error.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, swift
Domain
authentication, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.