public ConsentActionResult(IViewService viewSvc, ConsentViewModel model, ValidatedAuthorizeRequest validatedRequest) : base(async () => await viewSvc.Consent(model, validatedRequest)) { if (viewSvc == null) throw new ArgumentNullException("viewSvc"); if (model == null) throw new ArgumentNullException("model"); if (validatedRequest == null) throw new ArgumentNullException("validatedRequest"); }
public async Task<Stream> Consent (ConsentViewModel model, ValidatedAuthorizeRequest authorizeRequest) { return await Render (model, "Consent"); }
public Task<Stream> Consent(ConsentViewModel model, ValidatedAuthorizeRequest authorizeRequest) { return Task.FromResult(RunTemplate("consent", model, authorizeRequest.ClientId)); }
/// <summary> /// Loads the HTML for the user consent page. /// </summary> /// <param name="model">The model.</param> /// <param name="authorizeRequest">The validated authorize request.</param> /// <returns> /// Stream for the HTML /// </returns> public virtual Task<Stream> Consent(ConsentViewModel model, ValidatedAuthorizeRequest authorizeRequest) { return Render(model, ConsentView); }
private IHttpActionResult CreateConsentResult( ValidatedAuthorizeRequest validatedRequest, UserConsent consent, NameValueCollection requestParameters, string errorMessage) { string loginWithDifferentAccountUrl = null; if (validatedRequest.HasIdpAcrValue() == false) { loginWithDifferentAccountUrl = Url.Route(Constants.RouteNames.Oidc.SwitchUser, null) .AddQueryString(requestParameters.ToQueryString()); } var env = Request.GetOwinEnvironment(); var consentModel = new ConsentViewModel { RequestId = env.GetRequestId(), SiteName = _options.SiteName, SiteUrl = env.GetIdentityServerBaseUrl(), ErrorMessage = errorMessage, CurrentUser = env.GetCurrentUserDisplayName(), LogoutUrl = env.GetIdentityServerLogoutUrl(), ClientName = validatedRequest.Client.ClientName, ClientUrl = validatedRequest.Client.ClientUri, ClientLogoUrl = validatedRequest.Client.LogoUri, IdentityScopes = validatedRequest.GetIdentityScopes(this._localizationService), ResourceScopes = validatedRequest.GetResourceScopes(this._localizationService), AllowRememberConsent = validatedRequest.Client.AllowRememberConsent, RememberConsent = consent == null || consent.RememberConsent, LoginWithDifferentAccountUrl = loginWithDifferentAccountUrl, ConsentUrl = Url.Route(Constants.RouteNames.Oidc.Consent, null).AddQueryString(requestParameters.ToQueryString()), AntiForgery = _antiForgeryToken.GetAntiForgeryToken() }; return new ConsentActionResult(_viewService, consentModel, validatedRequest); }
public Task<Stream> Consent(ConsentViewModel model, ValidatedAuthorizeRequest authorizeRequest) { throw new NotImplementedException(); }
/// <summary> /// Loads the HTML for the user consent page. /// </summary> /// <param name="model"> /// The model. /// </param> /// <returns> /// The <see cref="ActionResult"/>. /// </returns> public ActionResult Consent(ConsentViewModel model) { return this.View(model); }