/// <summary>
        /// Finalize transaction for state "OK".
        /// </summary>
        protected override void finalizeTransaction()
        {
            base.finalizeTransaction();
            try
            {
                var accessToken = getAccessToken();
                credentials = rublon.GetCredentials(accessToken);
            }
            catch (ConnectionException ex)
            {
                throw new CallbackException("Connection problem in the Rublon callback method when trying to get auth credentials.", ex);
            }
            catch (APIException ex)
            {
                throw new CallbackException("Rublon API error in the Rublon callback method when trying to get auth credentials.", ex);
            }

            var userId = credentials.GetUserId();
            userAuthenticated(userId);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Authenticate user and get user's credentials using one-time use access token.
 /// 
 /// One-time use access token is a session identifier which will be deleted after first usage.
 /// This method can be called only once in authentication process.
 /// </summary>
 /// <param name="accessToken"></param>
 /// <returns></returns>
 public Credentials GetCredentials(string accessToken)
 {
     var credentials = new Credentials(this, accessToken);
     credentials.Perform();
     return credentials;
 }