Skip to content
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

[SDK] SDK V2, no API for login with login type parameter - Cannot login. #4266

Closed
isabeD opened this issue Oct 19, 2021 · 6 comments · Fixed by #4346
Closed

[SDK] SDK V2, no API for login with login type parameter - Cannot login. #4266

isabeD opened this issue Oct 19, 2021 · 6 comments · Fixed by #4346
Assignees
Labels
matrix-sdk T-Enhancement New features, changes in functionality, performance boosts, user-facing improvements

Comments

@isabeD
Copy link

isabeD commented Oct 19, 2021

Description

Our Matrix environment / synapse supports "proprietary" login flow.
Requesting from app the list of loginFlow supported types returns a list like this :
m.login.password
com.xx.login.istra
...

Using SDK V2, no API permit to add the login type "com.xx.login.istra" as parameter.
That prevent our android app to login using regular API authenticationService / Wizard which always returns an error code "FORBIDDEN".
As workaround, app perform login out of Matrix SDK - app send an HTTP request + appropriate json adding type = com.xx.login.istra. That's not good, we do not mesure very well the side effects of that.

@bmarty
Copy link
Member

bmarty commented Oct 19, 2021

We can add a method in the interface LoginWizard as below:

    /**
     * Login to the homeserver by sending a custom JsonDict.
     * The data should contain at least one entry "type" with a String value.
     */
    suspend fun loginCustom(data: JsonDict): Session

Will this fully suit your needs?

@bmarty bmarty self-assigned this Oct 19, 2021
@isabeD
Copy link
Author

isabeD commented Oct 20, 2021

Hi, Thanks for your quick answer.

According your proposal app should call :
loginCustomData(myjsonDict)

with that kind of jsonDict key / values :
type : com.xx.login.istra
initial_device_display_name : "mydevice"
password: "mypwd"
user: "@XX"

SDK execute request https://homeserver/_matrix/client/r0/login + payload issued from jsonDict
... Matrix do its SDK stuffs.
Then Matrix SDK returns a session -if login ok- If I'm correct that fit our needs!

@bmarty
Copy link
Member

bmarty commented Oct 20, 2021

I think we have a plan then! I add the issue to the next milestone, so this should be available in the SDK 1.3.5.

@bmarty bmarty added this to the Sprint - Element 1.3.5 milestone Oct 20, 2021
@bmarty
Copy link
Member

bmarty commented Oct 20, 2021

One confirmation please :

The request https://homeserver/_matrix/client/r0/login + payload issued from jsonDict will return regular Credentials?

@isabeD
Copy link
Author

isabeD commented Oct 20, 2021

yes. here a sample of synapse login's json response :
access_token: "xx"
device_id: "xx"
home_server: "fqdn server"
user_id: "@x"
well_known: {m.homeserver: {base_url: "urlserver"}}
m.homeserver: {base_url: "urlserver"}

@ouchadam ouchadam added the T-Enhancement New features, changes in functionality, performance boosts, user-facing improvements label Oct 25, 2021
@bmarty
Copy link
Member

bmarty commented Oct 26, 2021

Will be part of SDK 1.3.7 and up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
matrix-sdk T-Enhancement New features, changes in functionality, performance boosts, user-facing improvements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants