Examples of Authorization


Examples of org.camunda.bpm.engine.authorization.Authorization

  }
 
  @Test
  public void testGetAuthorizationById() {
   
    Authorization authorization = MockProvider.createMockGlobalAuthorization();
   
    AuthorizationQuery authorizationQuery = mock(AuthorizationQuery.class);
    when(authorizationServiceMock.createAuthorizationQuery()).thenReturn(authorizationQuery);
    when(authorizationQuery.authorizationId(MockProvider.EXAMPLE_AUTHORIZATION_ID)).thenReturn(authorizationQuery);
    when(authorizationQuery.singleResult()).thenReturn(authorization);
    
    given()
        .pathParam("id", MockProvider.EXAMPLE_AUTHORIZATION_ID)
    .then().expect()
        .statusCode(Status.OK.getStatusCode()).contentType(ContentType.JSON)
        .body("id", equalTo(authorization.getId()))
        .body("type", equalTo(authorization.getAuthorizationType()))
        .body("permissions[0]", equalTo(Permissions.READ.getName()))
        .body("permissions[1]", equalTo(Permissions.UPDATE.getName()))
        .body("userId", equalTo(authorization.getUserId()))
        .body("groupId", equalTo(authorization.getGroupId()))
        .body("resourceType", equalTo(authorization.getResourceType()))
        .body("resourceId", equalTo(authorization.getResourceId()))       
    .when()
        .get(AUTH_RESOURCE_PATH);
    
  }
View Full Code Here

Examples of org.camunda.bpm.engine.authorization.Authorization

   
  @Test
  public void testAuthorizationResourceOptions() {
    String fullAuthorizationUrl = "http://localhost:" + PORT + TEST_RESOURCE_ROOT_PATH + AuthorizationRestService.PATH + "/" + MockProvider.EXAMPLE_AUTHORIZATION_ID;
   
    Authorization authorization = MockProvider.createMockGlobalAuthorization();
   
    AuthorizationQuery authorizationQuery = mock(AuthorizationQuery.class);
    when(authorizationServiceMock.createAuthorizationQuery()).thenReturn(authorizationQuery);
    when(authorizationQuery.authorizationId(MockProvider.EXAMPLE_AUTHORIZATION_ID)).thenReturn(authorizationQuery);
    when(authorizationQuery.singleResult()).thenReturn(authorization);
View Full Code Here

Examples of org.camunda.bpm.engine.authorization.Authorization

 
  @Test
  public void testAuthorizationResourceOptionsUnauthorized() {
    String fullAuthorizationUrl = "http://localhost:" + PORT + TEST_RESOURCE_ROOT_PATH + AuthorizationRestService.PATH + "/" + MockProvider.EXAMPLE_AUTHORIZATION_ID;
   
    Authorization authorization = MockProvider.createMockGlobalAuthorization();
   
    AuthorizationQuery authorizationQuery = mock(AuthorizationQuery.class);
    when(authorizationServiceMock.createAuthorizationQuery()).thenReturn(authorizationQuery);
    when(authorizationQuery.authorizationId(MockProvider.EXAMPLE_AUTHORIZATION_ID)).thenReturn(authorizationQuery);
    when(authorizationQuery.singleResult()).thenReturn(authorization);
View Full Code Here

Examples of org.camunda.bpm.engine.authorization.Authorization

   
  @Test
  public void testAuthorizationResourceOptionsUpdateUnauthorized() {
    String fullAuthorizationUrl = "http://localhost:" + PORT + TEST_RESOURCE_ROOT_PATH + AuthorizationRestService.PATH + "/" + MockProvider.EXAMPLE_AUTHORIZATION_ID;
   
    Authorization authorization = MockProvider.createMockGlobalAuthorization();
   
    AuthorizationQuery authorizationQuery = mock(AuthorizationQuery.class);
    when(authorizationServiceMock.createAuthorizationQuery()).thenReturn(authorizationQuery);
    when(authorizationQuery.authorizationId(MockProvider.EXAMPLE_AUTHORIZATION_ID)).thenReturn(authorizationQuery);
    when(authorizationQuery.singleResult()).thenReturn(authorization);
View Full Code Here

Examples of org.cipango.sip.security.Authorization

    ListIterator<String> authenticates = challengeResponse.getHeaders(SipHeaders.WWW_AUTHENTICATE);
    while (authenticates.hasNext())
    {
      Authenticate authenticate = new Authenticate(authenticates.next());
      AuthElement element = ((AuthInfoImpl) authInfo).getAuthElement(challengeResponse.getStatus(), authenticate.getRealm());
      Authorization authorization =
        new Authorization(authenticate, element.getUsername(), element.getPassword(), getRequestURIAsString(), getMethod());
      addHeader(SipHeaders.AUTHORIZATION, authorization.toString());
    }
    authenticates = challengeResponse.getHeaders(SipHeaders.PROXY_AUTHENTICATE);
    while (authenticates.hasNext())
    {
      Authenticate authenticate = new Authenticate(authenticates.next());
      AuthElement element = ((AuthInfoImpl) authInfo).getAuthElement(challengeResponse.getStatus(), authenticate.getRealm());
      Authorization authorization =
        new Authorization(authenticate, element.getUsername(), element.getPassword(), getRequestURIAsString(), getMethod());
      addHeader(SipHeaders.PROXY_AUTHORIZATION, authorization.toString());
    }
  }
View Full Code Here

Examples of org.cipango.sip.security.Authorization

  {
    ListIterator<String> authenticates = challengeResponse.getHeaders(SipHeaders.WWW_AUTHENTICATE);
    while (authenticates.hasNext())
    {
      Authenticate authenticate = new Authenticate(authenticates.next());
      Authorization authorization =
        new Authorization(authenticate, username, password, getRequestURIAsString(), getMethod());
      addHeader(SipHeaders.AUTHORIZATION, authorization.toString());
    }
    authenticates = challengeResponse.getHeaders(SipHeaders.PROXY_AUTHENTICATE);
    while (authenticates.hasNext())
    {
      Authenticate authenticate = new Authenticate(authenticates.next());
      Authorization authorization =
        new Authorization(authenticate, username, password, getRequestURIAsString(), getMethod());
      addHeader(SipHeaders.PROXY_AUTHORIZATION, authorization.toString());
    }
  }
View Full Code Here

Examples of org.eclipse.egit.github.core.Authorization

    private static GitHubClient createClient(String user, String pass) throws Exception {
        GitHubClient cliente = new GitHubClient();
        cliente.setCredentials(user, pass);
        OAuthService oauth = new OAuthService(cliente);
        Authorization auth = new Authorization();

        try {
            String token;
            if (oauth.getAuthorizations() == null || oauth.getAuthorizations().isEmpty()) {
                auth = oauth.createAuthorization(auth);
                token = auth.getToken();
                System.out.println("autorizooou: " + token);
            } else {
                List<Authorization> auths = oauth.getAuthorizations();
                System.out.println("autorizaçoes: " + auths.size());
                System.out.println("autorização: " + auths.get(0));
View Full Code Here

Examples of org.fcrepo.server.security.Authorization

                throw new InternalError500Exception(request,
                                                    actionLabel,
                                                    "server not available",
                                                    new String[0]);
            }
            Authorization authModule = null;
            authModule =
                    m_server.getBean("org.fcrepo.server.security.Authorization", Authorization.class);
            if (authModule == null) {
                throw new InternalError500Exception(request,
                                                    actionLabel,
                                                    "Required Authorization module not available",
                                                    new String[0]);
            }
            try {
                authModule.reloadPolicies(context);
            } catch (AuthzOperationalException aoe) {
                throw new Forbidden403Exception(request,
                                                actionLabel,
                                                "authorization failed",
                                                new String[0]);
View Full Code Here

Examples of org.globus.gsi.gssapi.auth.Authorization

        } catch (Exception e) {
            throw new ExecutionProblem("Problem constructing GridFTPClient: " +
                                                e.getMessage());
        }

        final Authorization auth;
        if (identityAuthorization == null) {
            auth = HostAuthorization.getInstance();
            if (debug != null) {
                debug.println(
                        "Using host-based authorization of remote server");
View Full Code Here

Examples of org.glyptodon.guacamole.net.basic.auth.Authorization

    public Map<String, GuacamoleConfiguration>
            getAuthorizedConfigurations(Credentials credentials)
            throws GuacamoleException {

        // Validate and return info for given user and pass
        Authorization auth = getUserMapping().getAuthorization(credentials.getUsername());
        if (auth != null && auth.validate(credentials.getUsername(), credentials.getPassword()))
            return auth.getConfigurations();

        // Unauthorized
        return null;

    }
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.