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();
}
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);
}
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;
}
Aggregations