示例#1
0
        public async Task <IActionResult> ClientCredentials([FromServices] NexaasID nexaasId)
        {
            var tokenResponse = await nexaasId.GetClientAuthorizationToken("profile invite");

            ViewBag.AccessToken = tokenResponse?.Data.AccessToken;

            return(View());
        }
        public void CantGetClientAccessTokenWithEmptyScope()
        {
            Exception exception =
                Assert.ThrowsAsync <NexaasIDException>(() =>
                                                       NexaasIdInstance.GetClientAuthorizationToken(string.Empty))
                .Result;

            Assert.Equal(exception.Message, Messages.EmptyScope);
        }