Search in sources :

Example 1 with Service

use of org.jasig.cas.authentication.principal.Service in project uPortal by Jasig.

the class ConfigurableUserAgentOverrideThemeResolver method resolveServiceThemeName.

/**
     * Resolve the theme for the service. This method's logic is taken from ServiceThemeResolver.
     *
     * @param request
     * @return configured theme for this service
     */
protected String resolveServiceThemeName(HttpServletRequest request) {
    if (this.servicesManager == null) {
        return getDefaultThemeName();
    }
    final Service service = WebUtils.getService(this.argumentExtractors, request);
    final RegisteredService rService = this.servicesManager.findServiceBy(service);
    return service != null && rService != null && StringUtils.hasText(rService.getTheme()) ? rService.getTheme() : getDefaultThemeName();
}
Also used : RegisteredService(org.jasig.cas.services.RegisteredService) Service(org.jasig.cas.authentication.principal.Service) RegisteredService(org.jasig.cas.services.RegisteredService)

Example 2 with Service

use of org.jasig.cas.authentication.principal.Service in project oxTrust by GluuFederation.

the class ClientAction method prepareForLoginPage.

/**
	 * Prepare the data for the login page
	 * 
	 * @param context The current webflow context
	 * @param webContext The current web context
	 */
protected void prepareForLoginPage(final RequestContext context, final WebContext webContext) {
    // Save parameters in web session
    final Service service = (Service) context.getFlowScope().get(SERVICE);
    if (service != null) {
        webContext.setSessionAttribute(SERVICE, service);
    }
    saveRequestParameter(webContext, THEME);
    saveRequestParameter(webContext, LOCALE);
    saveRequestParameter(webContext, METHOD);
    final String keyRedirectionUrl = this.client.getName() + "Url";
    final String redirectionUrl = this.client.getRedirectionUrl(webContext);
    logger.debug("Generated redirection Url", redirectionUrl);
    context.getFlowScope().put(keyRedirectionUrl, redirectionUrl);
    final String keyAuthMethod = this.client.getName() + "OpenIdDefaultAuthenticator";
    final Boolean keyAuthMethodValue = this.client.isOpenIdDefaultAuthenticator();
    logger.debug("OpenIdDefaultAuthenticator", keyAuthMethodValue);
    context.getFlowScope().put(keyAuthMethod, keyAuthMethodValue);
}
Also used : Service(org.jasig.cas.authentication.principal.Service) CentralAuthenticationService(org.jasig.cas.CentralAuthenticationService)

Example 3 with Service

use of org.jasig.cas.authentication.principal.Service in project oxTrust by GluuFederation.

the class ClientAction method getClientCrendentials.

/**
	 * Build client credenatils from incomming request
	 * 
	 * @param context The current webflow context
	 * @param webContext The current web context
	 * @return client credentials
	 */
private ClientCredential getClientCrendentials(final RequestContext context, final WebContext webContext) {
    final OpenIdCredentials openIdCredentials = client.getCredentials(webContext);
    final ClientCredential credentials = new ClientCredential(openIdCredentials);
    // Retrieve parameters from web session
    final Service service = (Service) webContext.getSessionAttribute(SERVICE);
    if (service != null) {
        webContext.setRequestAttribute(SERVICE, service.getId());
    }
    context.getFlowScope().put(SERVICE, service);
    restoreRequestAttribute(webContext, THEME);
    restoreRequestAttribute(webContext, LOCALE);
    restoreRequestAttribute(webContext, METHOD);
    return credentials;
}
Also used : ClientCredential(org.gluu.oxauth.cas.auth.principal.ClientCredential) OpenIdCredentials(org.gluu.oxauth.client.auth.principal.OpenIdCredentials) Service(org.jasig.cas.authentication.principal.Service) CentralAuthenticationService(org.jasig.cas.CentralAuthenticationService)

Aggregations

Service (org.jasig.cas.authentication.principal.Service)3 CentralAuthenticationService (org.jasig.cas.CentralAuthenticationService)2 ClientCredential (org.gluu.oxauth.cas.auth.principal.ClientCredential)1 OpenIdCredentials (org.gluu.oxauth.client.auth.principal.OpenIdCredentials)1 RegisteredService (org.jasig.cas.services.RegisteredService)1