Closed warting closed 5 years ago
Sounds good. So we would start with a login() method returning the Token, then we initialize the Client with it (or ClientAPI) and if the result contains an error we could just throw an exception with the appropriate Error code inside
Exactly. I'm halfway done with that in a branch i'm currently working on, meaning I can do it :)
Fixed in https://github.com/thomasletsch/bisecure-gateway/pull/8 but still need some improvements
When implementing the clientAPi in the android app it become a bit bothersome that the library was trying to solve some flaky issues and i would rather be in control in the consumer app of what should happen instead of having the library trying to solve issues with re-login for example.
The reason for this is that i would like to use android account manager that have it's own mechanism to store credentials/password/tokens and also refresh tokens when they are invalid to let user re-authenticate if needed etc..
What I would like to do is basically to create a function that exchange username+password to an authToken. and when i try to call something and have invalid credentials(token) i would like to get an error or exception back. Solve the issue and then set a new token to the ClientApi
What do you think @thomasletsch ?