示例#1
0
        public ActionResult ExplicitIndex()
        {
            ConsumerKeyModel model = this.GenerateConsumerKeyModel();

            model.CallbackUrl = this.Request.Url.Scheme + "://" + this.Request.Url.Authority + "/OpenAuth/OAuthCallback";

            return(View(model));
        }
示例#2
0
        private ConsumerKeyModel GenerateConsumerKeyModel()
        {
            OAuthKeyConfiguration oauthConfiguration = OAuthKeyConfiguration.GetInstance();

            ConsumerKeyModel model = new ConsumerKeyModel();

            model.ConsumerKey    = oauthConfiguration.ConsumerKey;
            model.ConsumerSecret = oauthConfiguration.ConsumerSecret;
            model.CallbackUrl    = this.Request.Url.Scheme + "://" + this.Request.Url.Authority + "/OpenAuth/OAuthCallback";

            model.EndpointModel = this.GenerateEndPointModel();

            return(model);
        }
示例#3
0
        public ActionResult Index()
        {
            OAuthKeyConfiguration oauthConfiguration    = OAuthKeyConfiguration.GetInstance();
            EndpointConfiguration endpointConfiguration = EndpointConfiguration.GetInstance();

            ConsumerKeyModel model = new ConsumerKeyModel();

            model.ConsumerKey    = oauthConfiguration.ConsumerKey;
            model.ConsumerSecret = oauthConfiguration.ConsumerSecret;
            model.CallbackUrl    = this.Request.Url.Scheme + "://" + this.Request.Url.Authority + "/DevDefined/OAuthCallback";

            EndpointModel endpointModel = new EndpointModel();

            endpointModel.ServiceUri       = endpointConfiguration.ServiceUri;
            endpointModel.RequestTokenUri  = endpointConfiguration.RequestTokenUri;
            endpointModel.AuthorizationUri = endpointConfiguration.AuthorizationUri;
            endpointModel.AccessTokenUri   = endpointConfiguration.AccessTokenUri;
            model.EndpointModel            = endpointModel;

            return(View(model));
        }