Package railo.runtime.security

Examples of railo.runtime.security.Credential


    public int doStartTag() throws PageException  {
     
      ApplicationContext ac=pageContext.getApplicationContext();
      ac.setSecuritySettings(applicationtoken,cookiedomain,idletimeout);
     
        Credential remoteUser = pageContext.getRemoteUser();
        if(remoteUser==null) {
           
            // Form
            Object name=pageContext.formScope().get("j_username",null);
            Object password=pageContext.formScope().get("j_password",null);
View Full Code Here


import railo.runtime.ext.function.Function;
import railo.runtime.security.Credential;

public final class IsUserLoggedIn implements Function {
  public static boolean call(PageContext pc) throws PageException {
    Credential ru = pc.getRemoteUser();
      return ru!=null;
  }
View Full Code Here

import railo.runtime.ext.function.Function;
import railo.runtime.security.Credential;

public final class GetAuthUser implements Function {
  public static String call(PageContext pc ) throws PageException {
      Credential remoteUser = pc.getRemoteUser();
      if(remoteUser==null) {
            String user=pc. getHttpServletRequest().getRemoteUser();
            if(user!=null) {
                return user;
            }
            return "";
        }
        return remoteUser.getUsername();
       
  }
View Full Code Here

  public static boolean call(PageContext pc) throws PageException {
    return call(pc, null);
  }
  public static boolean call(PageContext pc, String strRoles) throws PageException {
    if(StringUtil.isEmpty(strRoles)){
      Credential ru = pc.getRemoteUser();
      if(ru==null) return false;
        return ru.getRoles().length>0;
    }
   
    String[] roles = ListUtil.trimItems(ListUtil.listToStringArray(strRoles, ','));
    for(int i=0;i<roles.length;i++) {
      if(IsUserInRole.call(pc, roles[i])) return true;
View Full Code Here

import railo.runtime.security.CredentialImpl;

public final class IsUserInRole implements Function {
  public static boolean call(PageContext pc , Object object) throws PageException {
      String[] givenRoles = CredentialImpl.toRole(object);
      Credential ru = pc.getRemoteUser();
      if(ru==null) return false;
      String[] roles = ru.getRoles();
      for(int i=0;i<roles.length;i++) {
          for(int y=0;y<givenRoles.length;y++) {
              if(roles[i].equalsIgnoreCase(givenRoles[y])) return true;
          }
      }
View Full Code Here

import railo.runtime.security.Credential;
import railo.runtime.type.util.ListUtil;

public final class GetUserRoles implements Function {
  public static String call(railo.runtime.PageContext pc) throws PageException {
    Credential ru = pc.getRemoteUser();
      if(ru==null) return "";
      return ListUtil.arrayToList(ru.getRoles(), ",");
  }
View Full Code Here

TOP

Related Classes of railo.runtime.security.Credential

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.