Examples of generateToken()


Examples of org.apache.syncope.core.persistence.beans.user.SyncopeUser.generateToken()

    @Override
    protected void doExecute(final DelegateExecution execution) throws Exception {
        SyncopeUser user = (SyncopeUser) execution.getVariable(ActivitiUserWorkflowAdapter.SYNCOPE_USER);

        user.generateToken(
                Integer.parseInt(confDAO.find("token.length", "256").getValue()),
                Integer.parseInt(confDAO.find("token.expireTime", "60").getValue()));

        execution.setVariable(ActivitiUserWorkflowAdapter.SYNCOPE_USER, user);
    }
View Full Code Here

Examples of org.apache.syncope.core.persistence.beans.user.SyncopeUser.generateToken()

    @Override
    protected void doExecute(final DelegateExecution execution) throws Exception {

        SyncopeUser user = (SyncopeUser) execution.getVariable(ActivitiUserWorkflowAdapter.SYNCOPE_USER);

        user.generateToken(Integer.parseInt(confDAO.find("token.length", "256").getValue()), Integer.parseInt(confDAO
                .find("token.expireTime", "60").getValue()));
    }
}
View Full Code Here

Examples of org.apache.syncope.core.persistence.beans.user.SyncopeUser.generateToken()

    @Override
    protected void doExecute(final String executionId) {
        SyncopeUser user =
                (SyncopeUser) runtimeService.getVariable(executionId, ActivitiUserWorkflowAdapter.SYNCOPE_USER);

        user.generateToken(
                confDAO.find("token.length", "256").getValues().get(0).getLongValue().intValue(),
                confDAO.find("token.expireTime", "60").getValues().get(0).getLongValue().intValue());

        runtimeService.setVariable(executionId, ActivitiUserWorkflowAdapter.SYNCOPE_USER, user);
    }
View Full Code Here

Examples of org.springframework.security.web.csrf.CsrfTokenRepository.generateToken()

        public MockHttpServletRequest postProcessRequest(
                MockHttpServletRequest request) {

            CsrfTokenRepository repository = WebTestUtils
                    .getCsrfTokenRepository(request);
            CsrfToken token = repository.generateToken(request);
            repository.saveToken(token, request, new MockHttpServletResponse());
            String tokenValue = useInvalidToken ? "invalid" + token.getToken() : token.getToken();
            if(asHeader) {
                request.addHeader(token.getHeaderName(), tokenValue);
            } else {
View Full Code Here

Examples of org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository.generateToken()

        request.setServletPath("/login");
        request.setMethod("POST");
        request.setParameter("username", "user");
        request.setParameter("password", "password");
        HttpSessionCsrfTokenRepository repository = new HttpSessionCsrfTokenRepository();
        CsrfToken token = repository.generateToken(request);
        repository.saveToken(token, request, response);
        request.setParameter(token.getParameterName(),token.getToken());
        when(ReflectionUtils.findMethod(HttpServletRequest.class, "changeSessionId")).thenReturn(method);

        loadConfig(SessionManagementDefaultSessionFixationServlet31Config.class);
View Full Code Here

Examples of org.waveprotocol.wave.model.id.TokenGenerator.generateToken()

  private OAuthConsumer consumer;

  @Override
  protected void setUp() throws Exception {
    TokenGenerator tokenGenerator = mock(TokenGenerator.class);
    when(tokenGenerator.generateToken(anyInt())).thenReturn(FAKE_TOKEN);
    container = new DataApiTokenContainer(tokenGenerator);
    OAuthServiceProvider serviceProvider = new OAuthServiceProvider("", "", "");
    consumer = new OAuthConsumer("", "consumerkey", "consumersecret", serviceProvider);
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.id.TokenGenerator.generateToken()

  protected void setUp() throws Exception {
    validator = mock(OAuthValidator.class);
    sessionManager = mock(SessionManager.class);

    TokenGenerator tokenGenerator = mock(TokenGenerator.class);
    when(tokenGenerator.generateToken(anyInt())).thenReturn(FAKE_TOKEN);
    tokenContainer = new DataApiTokenContainer(tokenGenerator);

    req = mock(HttpServletRequest.class);
    when(req.getRequestURL()).thenReturn(new StringBuffer("www.example.com/robot"));
    when(req.getLocale()).thenReturn(Locale.ENGLISH);
View Full Code Here

Examples of org.waveprotocol.wave.model.id.TokenGenerator.generateToken()

    waveletProvider = mock(WaveletProvider.class);
    operationRegistry = mock(OperationServiceRegistry.class);
    ConversationUtil conversationUtil = mock(ConversationUtil.class);
    validator = mock(OAuthValidator.class);
    TokenGenerator tokenGenerator = mock(TokenGenerator.class);
    when(tokenGenerator.generateToken(anyInt())).thenReturn(FAKE_TOKEN);
    tokenContainer = new DataApiTokenContainer(tokenGenerator);

    OAuthServiceProvider serviceProvider = new OAuthServiceProvider("", "", "");
    consumer = new OAuthConsumer("", "consumerkey", "consumersecret", serviceProvider);
View Full Code Here

Examples of org.waveprotocol.wave.model.id.TokenGenerator.generateToken()

  @Override
  protected void setUp() throws Exception {
    ServerFrontendAddressHolder frontendAddressHolder = mock(ServerFrontendAddressHolder.class);
    when(frontendAddressHolder.getAddresses()).thenReturn(Lists.newArrayList("localhost:9898"));
    TokenGenerator tokenGenerator = mock(TokenGenerator.class);
    when(tokenGenerator.generateToken(anyInt())).thenReturn("abcde");
    AccountStore accountStore = mock(AccountStore.class);
    RobotRegistrar registar = mock(RobotRegistrar.class);
    agent =
        new FakeRobotAgent("example.com", tokenGenerator, frontendAddressHolder, accountStore,
            registar, false);
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.