Examples of authorize()


Examples of org.jboss.security.authorization.modules.web.WebXACMLPolicyModuleDelegate.authorize()

      WebResource er = getResource(policyRegistration);
      er.setPolicyContextID(this.contextID);
     
      er.setServletRequest(new TestHttpServletRequest(p, uri, "GET"));
      assertEquals(AuthorizationContext.PERMIT,
            pc.authorize(er, getSubject(), getRoleGroup()));
     
      Principal principal = new SimplePrincipal("Notjduke");
      HttpServletRequest hsr = new TestHttpServletRequest(principal, uri, "GET");
      //Now change the ejb principal
      er.setServletRequest(hsr);
View Full Code Here

Examples of org.jboss.security.integration.ejb.EJBAuthorizationHelper.authorize()

            String iface = (locator != null) ? "Remote" : "Local";
           
            RunAsIdentity callerRunAs = SecurityActions.peekRunAsIdentity();
           
            EJBAuthorizationHelper helper = new EJBAuthorizationHelper(sc);
            boolean isAuthorized = helper.authorize(ejbName,
                             mi.getMethod(),
                             sc.getUtil().getUserPrincipal(),
                             iface,
                             ejbCS,
                             sc.getUtil().getSubject(),
View Full Code Here

Examples of org.jboss.security.javaee.AbstractEJBAuthorizationHelper.authorize()

        Principal userPrincipal = securityContext.getUtil().getUserPrincipal();
        resource.setPrincipal(userPrincipal);

        try {
            AbstractEJBAuthorizationHelper helper = SecurityHelperFactory.getEJBAuthorizationHelper(securityContext);
            return helper.authorize(resource);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

Examples of org.jboss.security.plugins.JBossAuthorizationManager.authorize()

      // using the authorization manager, check if the identities have the expected permissions.
      JBossAuthorizationManager jam = new JBossAuthorizationManager("test-acl");

      // check that Administrator has all permissions on both resources.
      Identity identity = IdentityFactory.createIdentity("Administrator");
      assertEquals(AuthorizationContext.PERMIT, jam.authorize(resource1, identity, new CompositeACLPermission(
            BasicACLPermission.values())));
      assertEquals(AuthorizationContext.PERMIT, jam.authorize(resource2, identity, new CompositeACLPermission(
            BasicACLPermission.values())));

      // check that Guest has only READ permission on resource1.
View Full Code Here

Examples of org.jboss.security.plugins.authorization.JBossAuthorizationContext.authorize()

            new Subject(),
            new TestCallbackHandler());
      aContext.setApplicationPolicy(policyConfig.get(policyName));
      try
      {
         result =  aContext.authorize(new Resource()
         {
            public ResourceType getLayer()
            {
               return ResourceType.WEB;
            }
View Full Code Here

Examples of org.jboss.security.plugins.authorization.JBossAuthorizationContext.authorize()

            new Subject(),
            new TestCallbackHandler());
      aContext.setApplicationPolicy(policyConfig.get(policyName));
      try
      {
         result =  aContext.authorize(new Resource()
         {
            public ResourceType getLayer()
            {
               return ResourceType.WEB;
            }
View Full Code Here

Examples of org.mule.security.oauth.OAuth1Adapter.authorize()

            extraParameters.put("state", this.toString(event, this.getState()));
        }

        moduleObject.setAccessTokenUrl(this.toString(event, this.getAccessTokenUrl()));

        String location = moduleObject.authorize(extraParameters, requestTokenUrl, this.getAccessTokenUrl(),
            this.getAuthorizationUrl(), this.getOauthCallback().getUrl());

        this.notifyAuthorizeStart(event);

        event.getMessage().setOutboundProperty(OAuthProperties.HTTP_STATUS, "302");
View Full Code Here

Examples of org.uberfire.security.authz.AuthorizationManager.authorize()

        final org.uberfire.java.nio.security.AuthorizationManager ioAuthorizationManager = new org.uberfire.java.nio.security.AuthorizationManager() {
            @Override
            public boolean authorize( final FileSystem fs,
                                      final Subject subject ) {
                return authorizationManager.authorize( new FileSystemResourceAdaptor( fs ), ( (SubjectWrapper) subject ).getRealSubject() );
            }
        };

        for ( final FileSystemProvider fileSystemProvider : FileSystemProviders.installedProviders() ) {
            if ( fileSystemProvider instanceof SecurityAware ) {
View Full Code Here

Examples of weibo4j.Oauth.authorize()

import weibo4j.util.BareBonesBrowserLaunch;

public class OAuth4Code {
  public static void main(String [] args) throws WeiboException, IOException{
    Oauth oauth = new Oauth();
    BareBonesBrowserLaunch.openURL(oauth.authorize("code"));
    System.out.println(oauth.authorize("code"));
    System.out.print("Hit enter when it's done.[Enter]:");
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    String code = br.readLine();
View Full Code Here

Examples of weibo4j.Oauth.authorize()

public class OAuth4Code {
  public static void main(String [] args) throws WeiboException, IOException{
    Oauth oauth = new Oauth();
    BareBonesBrowserLaunch.openURL(oauth.authorize("code"));
    System.out.println(oauth.authorize("code"));
    System.out.print("Hit enter when it's done.[Enter]:");
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    String code = br.readLine();
    Log.logInfo("code: " + code);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.