Example #1
0
        public IAsyncOperation ContinueOAuth(string clientId)
        {
            var scopes = new string[] { };

            var tokenUrl = TokenPath ?? "https://sso.simva.e-ucm.es/auth/realms/simva/protocol/openid-connect/token";
            var authUrl  = AuthPath ?? "https://sso.simva.e-ucm.es/auth/realms/simva/protocol/openid-connect/auth";

            var done = new AsyncCompletionSource();

            try
            {
                OpenIdUtility.TryContinueLogin(tokenUrl, clientId)
                .Then(authInfo =>
                {
                    AuthorizationInfo = authInfo;
                    done.SetCompleted();
                });
            }
            catch (ApiException ex)
            {
                done.SetException(new ApiException(ex.ErrorCode, "Failed to renew AuthorizationInfo: " + ex.Message));
            }

            return(done);
        }