public void CreateTokenAuthorizationResponseForImplicit()
        {
            IAuthorizationContext context = MakeAuthorizatonCodeContext(Parameters.ResponseTypeValues.AccessToken);
            IAuthorizationResponseBuilder builder = new AuthorizationResponseBuilder();

            Uri result = builder.CreateResponse(context);

            Assert.AreEqual("http://www.mysite.com/callback?param=maintain#access_token=access-token&expires_in=123&token_type=bearer&scope=read&state=special", result.AbsoluteUri);
        }
        public void CreateAuthorizationResponseForRedirectFlow()
        {
            IAuthorizationContext context = MakeAuthorizatonCodeContext(Parameters.ResponseTypeValues.AuthorizationCode);
            IAuthorizationResponseBuilder builder = new AuthorizationResponseBuilder();
            context.State = "";
            Uri result = builder.CreateResponse(context);

            Assert.AreEqual("http://www.mysite.com/callback?param=maintain&code=special-token-value", result.AbsoluteUri);
        }
        public void CreateErrorAuthorizationResponse()
        {
            IAuthorizationContext context = MakeErrorAuthorizationContext(Parameters.ResponseTypeValues.AuthorizationCode);
            context.Error.ErrorDescription = string.Empty;
            
            IAuthorizationResponseBuilder builder = new AuthorizationResponseBuilder();

            Uri result = builder.CreateResponse(context);

            Assert.AreEqual("http://www.mysite.com/callback?param=maintain&error=access_denied", result.AbsoluteUri);
        }
        public void CreateErrorTokenAuthorizationResponse()
        {
            IAuthorizationContext context = MakeErrorAuthorizationContext(Parameters.ResponseTypeValues.AccessToken);
            IAuthorizationResponseBuilder builder = new AuthorizationResponseBuilder();

            Uri result = builder.CreateResponse(context);

            Assert.AreEqual("http://www.mysite.com/callback?param=maintain#error=access_denied&error_description=You%20do%20not%20have%20access", result.AbsoluteUri);
        }