Exemple #1
0
        /// <summary>
        /// Retrieves a new access token using BoxCCGAuth
        /// </summary>
        /// <param name="accessToken">This input is not used. Could be set to null</param>
        /// <returns>OAuth session</returns>
        public async Task <OAuthSession> RefreshAccessTokenAsync(string accessToken)
        {
            OAuthSession session = UserId != null
                ? BoxCCGAuth.Session(await BoxCCGAuth.UserTokenAsync(UserId).ConfigureAwait(false))
                : BoxCCGAuth.Session(await BoxCCGAuth.AdminTokenAsync().ConfigureAwait(false));

            Session = session;
            OnSessionAuthenticated(session);

            return(session);
        }
Exemple #2
0
 /// <summary>
 /// Constructor CCG auth repository
 /// </summary>
 /// <param name="session">OAuth session</param>
 /// <param name="boxCCGAuth">CCG authentication</param>
 /// <param name="userId">Id of the user</param>
 public CCGAuthRepository(OAuthSession session, BoxCCGAuth boxCCGAuth, string userId = null)
 {
     Session    = session;
     BoxCCGAuth = boxCCGAuth;
     UserId     = userId;
 }