famedly / matrix-dart-sdk

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

feat: support for JWT authentication #1774

Closed PhantomRay closed 5 months ago

PhantomRay commented 6 months ago

This adds the support for JWT authentication. It's now as easy as using the following code.

LoginResponse result = await _client.login(LoginType.mLoginJWT, token: accessToken);

In Synpase config file, add the following to allow JWT auth:

jwt_config:
  enabled: true
  secret: "YOUR_SECRET"
  algorithm: "HS256"

For more details, please refer to JWT Login Type

CLAassistant commented 6 months ago

CLA assistant check
All committers have signed the CLA.

PhantomRay commented 6 months ago

Hi @krille-chan will you be able to review this?

PhantomRay commented 6 months ago

Can you please shed some light on here?

td-famedly commented 6 months ago

Can you please shed some light on here?

https://github.com/famedly/matrix-dart-sdk/tree/main/lib/matrix_api_lite#generated-code has steps to generate api lite code

PhantomRay commented 6 months ago

@huangred can you please generate the code instead of editing the generated file directly?

PhantomRay commented 6 months ago

now using code generation tool.

PhantomRay commented 5 months ago

@td-famedly anything more I should do?

krille-chan commented 5 months ago

@PhantomRay can you squash your commits and give me write access to your branch so I can sign the commit with my key? Then we can merge this

PhantomRay commented 5 months ago

@krille-chan I have squashed the commits into one, and gave you written access to https://github.com/PhantomRay/matrix-dart-sdk

PhantomRay commented 5 months ago

At last! Thanks guys.