famedly / matrix-dart-sdk

Matrix SDK written in pure Dart.
GNU Affero General Public License v3.0
48 stars 30 forks source link

Need documentation on how to use login by token : LoginType.mLoginToken #1603

Open Alwein opened 8 months ago

Alwein commented 8 months ago

Preflight Checklist

Describe your problem

On the official Android SDK, we can login with access token using Matrix.authenticationService().createSessionFromSso(config, credentials)

While searching in the Dart SDK, i didn't find a similar method to login. Is LoginType.mLoginToken the equivalent of create session from sso on Android side ?

Describe your ideal solution

Can you add a sample of how to login using token to your readme or example file ?

Version

0.22.6

Security requirements

No response

Additional Context

No response

### Tasks
- [ ] Write a markdown file `/doc/sso_login.md` and describe how to login with single sign on
MichalNemec commented 8 months ago

as a workaround you can use matrix_api_lite: git: url: https://github.com/layerinfinity/dart_matrix_api_lite.git commit: f819b6d

krille-chan commented 8 months ago

Hey, we plan to improve the documentation for this. Until this you can take a look into this file where it is implemented in FluffyChat: https://github.com/krille-chan/fluffychat/blob/main/lib/pages/homeserver_picker/homeserver_picker.dart#L117

krille-chan commented 8 months ago

So the action point here would be to write a markdown file /doc/sso_login.md and describe how to login with single sign on

Alwein commented 8 months ago

Thank you, @MichalNemec and @krille-chan , for your prompt replies. I attempted to integrate my own login method using matrix_api_lite; however, it turns out that I do not require a complete SSO login mechanism. Instead, I simply need to log in with a token that I already possess, like it is described at the very end of this page

PhantomRay commented 2 months ago

PR created: https://github.com/famedly/matrix-dart-sdk/pull/1774