Esempio n. 1
0
 /// <summary>
 /// Lets a user refresh the token. Use the <see cref="MicAuthCredentials.RefreshToken"/> acquired from a <see cref="AuthLogin(MicAuthLoginRequest, CancellationToken)"/> call.
 /// By default, the refresh token is set to expire after 30 days but this can be changed to an arbitrary period.
 /// </summary>
 /// <returns>The response from refresh is exactly the same as from the login request, and should be handled the same way.</returns>
 /// <remarks>
 /// <para>
 /// To use the refresh token to get a new set of tokens, do the same call as you did when you logged in but use
 /// the refresh action instead and pass the refresh token as the argument. Please note that you need to reset
 /// your logins before you do this, otherwise you will try to do an authenticated call and since the
 /// access token is no longer valid, this will fail.
 /// </para>
 /// <para>
 /// In Managed IoT Cloud Appboard the refresh token is implemented by checking for errors and if the token has
 /// expired, it is refreshed and the operation is retried, and if it still fails, the user is redirected to the
 /// login page.
 /// </para>
 /// </remarks>
 public Task <MicAuthLoginResponse> AuthRefresh(MicAuthRefreshRequest request, CancellationToken cancelToken = default) =>
 HandleClientRequest <MicAuthRefreshRequest, MicAuthLoginResponse>(authRefreshUrl, HttpMethod.Post,
                                                                   request, hasPayload: true, cancelToken);
Esempio n. 2
0
 /// <summary>
 /// Lets a user refresh the token. Use the <see cref="MicAuthCredentials.RefreshToken"/> acquired from a <see cref="AuthLogin(MicAuthLoginRequest, CancellationToken)"/> call.
 /// By default, the refresh token is set to expire after 30 days but this can be changed to an arbitrary period.
 /// </summary>
 /// <returns>The response from refresh is exactly the same as from the login request, and should be handled the same way.</returns>
 /// <remarks>
 /// <para>
 /// To use the refresh token to get a new set of tokens, do the same call as you did when you logged in but use
 /// the refresh action instead and pass the refresh token as the argument. Please note that you need to reset
 /// your logins before you do this, otherwise you will try to do an authenticated call and since the
 /// access token is no longer valid, this will fail.
 /// </para>
 /// <para>
 /// In Managed IoT Cloud Appboard the refresh token is implemented by checking for errors and if the token has
 /// expired, it is refreshed and the operation is retried, and if it still fails, the user is redirected to the
 /// login page.
 /// </para>
 /// </remarks>
 public Task <MicAuthLoginResponse> AuthRefresh(MicAuthRefreshRequest request, CancellationToken cancelToken = default) =>
 HandleClientRequest <MicAuthRefreshRequest, MicAuthLoginResponse>(nameof(AuthRefresh), request, cancelToken);