-
Notifications
You must be signed in to change notification settings - Fork 1
TmcClient class
kimmoal edited this page Nov 22, 2017
·
5 revisions
TmcClient is the main class through which to communicate with the TMC server.
For now it makes the authentication request to the server to obtain the access token for further communication, and can get the authenticated user's info.
The plan is to use this class for all communication with TMC server, such as getting the new exercises and sending things to the server.
The way oauth2 authentication works in TestMyCode terms, is that a POST
request to the server is sent with the following parameters:
-
client_id
andclient_secret
: Used to authorize the client application. Fetched from the server at first startup, and static for the application at this time. Cached in applicationQSettings
. -
username
andpassword
: valid TestMyCode credentials to authenticate the user -
grant_type
aspassword
: to indicate we are using the oauth2 password authentication flow.
If the login information is correct, the server responds with a JSON that has our access token, which is then used in further communication with the server.