Examples of createToken()


Examples of org.apache.cxf.sts.token.provider.TokenProvider.createToken()

       
        TokenProviderParameters providerParameters =
            createProviderParameters(STSUtils.TOKEN_TYPE_SCT_05_12);
       
        assertTrue(sctTokenProvider.canHandleToken(STSUtils.TOKEN_TYPE_SCT_05_12));
        TokenProviderResponse providerResponse = sctTokenProvider.createToken(providerParameters);
        assertTrue(providerResponse != null);
        assertTrue(providerResponse.getToken() != null && providerResponse.getTokenId() != null);

        return providerResponse;
    }
View Full Code Here

Examples of org.apache.hadoop.lib.service.DelegationTokenManager.createToken()

      Arrays.asList(DelegationTokenManagerService.class.getName())));
    HttpFSServerWebApp server = new HttpFSServerWebApp(dir, dir, dir, dir, conf);
    server.setAuthority(new InetSocketAddress(InetAddress.getLocalHost(), 14000));
    server.init();
    DelegationTokenManager tm = server.get(DelegationTokenManager.class);
    Token token = tm.createToken(UserGroupInformation.getCurrentUser(), "foo");
    Assert.assertNotNull(token);
    tm.verifyToken(token);
    Assert.assertTrue(tm.renewToken(token, "foo") > System.currentTimeMillis());
    tm.cancelToken(token, "foo");
    try {
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.security.authentication.token.TokenProvider.createToken()

        Root root = adminSession.getLatestRoot();
        AuthenticationConfiguration authConfig = getSecurityProvider().getConfiguration(AuthenticationConfiguration.class);
        TokenProvider tp = authConfig.getTokenProvider(root);

        SimpleCredentials sc = (SimpleCredentials) getAdminCredentials();
        TokenInfo info = tp.createToken(sc.getUserID(), Collections.<String, Object>emptyMap());

        ContentSession cs = login(new TokenCredentials(info.getToken()));
        try {
            assertEquals(sc.getUserID(), cs.getAuthInfo().getUserID());
        } finally {
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.security.authentication.token.TokenProvider.createToken()

        Root root = adminSession.getLatestRoot();
        AuthenticationConfiguration authConfig = getSecurityProvider().getConfiguration(AuthenticationConfiguration.class);
        TokenProvider tp = authConfig.getTokenProvider(root);

        SimpleCredentials sc = (SimpleCredentials) getAdminCredentials();
        TokenInfo info = tp.createToken(sc.getUserID(), Collections.<String, Object>emptyMap());

        ContentSession cs = login(new TokenCredentials(info.getToken()));
        try {
            assertEquals(sc.getUserID(), cs.getAuthInfo().getUserID());
        } finally {
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.security.authentication.token.TokenProvider.createToken()

        Root root = adminSession.getLatestRoot();
        TokenConfiguration tc = getSecurityProvider().getConfiguration(TokenConfiguration.class);
        TokenProvider tp = tc.getTokenProvider(root);

        SimpleCredentials sc = (SimpleCredentials) getAdminCredentials();
        TokenInfo info = tp.createToken(sc.getUserID(), Collections.<String, Object>emptyMap());

        ContentSession cs = login(new TokenCredentials(info.getToken()));
        try {
            assertEquals(sc.getUserID(), cs.getAuthInfo().getUserID());
        } finally {
View Full Code Here

Examples of org.apache.shindig.auth.SecurityTokenCodec.createToken()

      } catch (UnsupportedEncodingException e) {
        log.logp(Level.WARNING, CLASS, method, "Error while encoding container.");
      }
    }
     
    return codec.createToken(tokenParameters);
  }
 
  public void putContainerInTokenParams(Map<String, String> tokenParams, String container) {
    String token = StringUtils.defaultString(tokenParams.get(SecurityTokenCodec.SECURITY_TOKEN_NAME));
    String[] parts = token.split(":");
View Full Code Here

Examples of org.exoplatform.portal.gadget.core.SecurityTokenGenerator.createToken()

    }

    public static String createToken(String gadgetURL, Long moduleId) {
        SecurityTokenGenerator tokenGenerator = (SecurityTokenGenerator) ExoContainerContext.getCurrentContainer()
                .getComponentInstanceOfType(SecurityTokenGenerator.class);
        return tokenGenerator.createToken(gadgetURL, moduleId);
    }

    /**
     * Gets map metadata of gadget application
     *
 
View Full Code Here

Examples of org.exoplatform.web.security.security.AbstractTokenService.createToken()

      }
      else
      {
         // We create a temporary token just for the login time
         TransientTokenService tokenService = AbstractTokenService.getInstance(TransientTokenService.class);
         String token = tokenService.createToken(credentials);
         req.getSession().removeAttribute(InitiateLoginServlet.CREDENTIALS);

         // Send authentication request
         log.debug("Login initiated with credentials in session, performing authentication");
         sendAuth(resp, credentials.getUsername(), token);
View Full Code Here

Examples of org.exoplatform.web.security.security.AbstractTokenService.createToken()

         boolean isRemember = "true".equals(req.getParameter(InitiateLoginServlet.COOKIE_NAME));
         if (isRemember)
         {
            //Create token
            AbstractTokenService tokenService = AbstractTokenService.getInstance(CookieTokenService.class);
            String cookieToken = tokenService.createToken(credentials);

            log.debug("Found a remember me request parameter, created a persistent token " + cookieToken + " for it and set it up " +
               "in the next response");
            Cookie cookie = new Cookie(InitiateLoginServlet.COOKIE_NAME, cookieToken);
            cookie.setPath(req.getContextPath());
View Full Code Here

Examples of org.exoplatform.web.security.security.CookieTokenService.createToken()

                    // Handle remember me
                    String rememberme = req.getParameter("rememberme");
                    if ("true".equals(rememberme)) {
                        // Create token for credentials
                        CookieTokenService tokenService = AbstractTokenService.getInstance(CookieTokenService.class);
                        String cookieToken = tokenService.createToken(credentials);
                        if (log.isDebugEnabled()) {
                            log.debug("Found a remember me request parameter, created a persistent token " + cookieToken
                                    + " for it and set it up " + "in the next response");
                        }
                        Cookie cookie = new Cookie(COOKIE_NAME, cookieToken);
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.