Examples of UserToken


Examples of com.google.gdata.client.GoogleAuthTokenFactory.UserToken

      ServiceException, DocumentListException {
    if (resourceId == null || filepath == null || format == null) {
      throw new DocumentListException("null passed in for required parameters");
    }

    UserToken docsToken = (UserToken) service.getAuthTokenFactory()
    .getAuthToken();
    UserToken spreadsheetsToken = (UserToken) spreadsheetsService
    .getAuthTokenFactory().getAuthToken();
    service.setUserToken(spreadsheetsToken.getValue());

    HashMap<String, String> parameters = new HashMap<String, String>();
    parameters
    .put("key", resourceId.substring(resourceId.lastIndexOf(':') + 1));
    parameters.put("exportFormat", format);
View Full Code Here

Examples of com.google.gdata.client.GoogleAuthTokenFactory.UserToken

      ServiceException, DocumentListException {
    if (resourceId == null || filepath == null || format == null) {
      throw new DocumentListException("null passed in for required parameters");
    }

    UserToken docsToken = (UserToken) service.getAuthTokenFactory()
        .getAuthToken();
    UserToken spreadsheetsToken = (UserToken) spreadsheetsService
        .getAuthTokenFactory().getAuthToken();
    service.setUserToken(spreadsheetsToken.getValue());

    HashMap<String, String> parameters = new HashMap<String, String>();
    parameters
        .put("key", resourceId.substring(resourceId.lastIndexOf(':') + 1));
    parameters.put("exportFormat", format);
View Full Code Here

Examples of com.google.gdata.client.GoogleAuthTokenFactory.UserToken

      DocumentListException {
    if (resourceId == null || filepath == null || format == null) {
      throw new DocumentListException("null passed in for required parameters");
    }

    UserToken docsToken = (UserToken) service.getAuthTokenFactory().getAuthToken();
    UserToken spreadsheetsToken = (UserToken) spreadsheetsService.getAuthTokenFactory().getAuthToken();
    service.setUserToken(spreadsheetsToken.getValue());

    HashMap<String, String> parameters = new HashMap<String, String>();
    parameters.put("key", resourceId.substring(resourceId.lastIndexOf(':') + 1));
    parameters.put("exportFormat", format);
View Full Code Here

Examples of com.walters.sms.rest.domain.UserToken

  private IServiceLocator getServiceLocator() {
    return ServiceLocator.getInstance();
  }

  private UserToken createUserToken(final User user) {
    UserToken userToken = null;

    if(CheckArg.isNotNull(user)){
      final long userId = user.getId();
      final String username = user.getUsername();
      final String password = user.getPassword();
      final String sessionToken = StringUtilities.encodeToBase24String(username + ":" + password);

      userToken = new UserToken(userId, sessionToken);
    }

    return userToken;
  }
View Full Code Here

Examples of org.beangle.ems.security.service.UserToken

  private static ThreadLocal<String> resource = new ThreadLocal<String>();

  private static UserToken getPrincipal() {
    Authentication auth = SecurityContextHolder.getContext().getAuthentication();
    if (null == auth) throw new AuthenticationException();
    UserToken user = (UserToken) auth.getPrincipal();
    if (null == user.getId()) throw new AuthenticationException();
    return user;
  }
View Full Code Here

Examples of org.beangle.ems.security.service.UserToken

import org.beangle.security.core.userdetail.UserDetailService;

public class SimpleUserDetailServiceImpl implements UserDetailService<Authentication> {

  public UserDetail loadDetail(Authentication token) {
    UserToken user = new UserToken(1L, token.getName(), token.getName(), "NULL", "user category a", true,
        false, false, false, new ArrayList<GrantedAuthority>());
    return user;
  }
View Full Code Here

Examples of org.beangle.ems.security.service.UserToken

  private static ThreadLocal<String> resource = new ThreadLocal<String>();

  public static UserToken getPrincipal() {
    Authentication auth = SecurityContextHolder.getContext().getAuthentication();
    if (null == auth) throw new AuthenticationException();
    UserToken user = (UserToken) auth.getPrincipal();
    if (null == user.getId()) throw new AuthenticationException();
    return user;
  }
View Full Code Here

Examples of org.beangle.security.blueprint.service.UserToken

  }

  protected UserToken getAuthentication() {
    Authentication auth = SecurityContextHolder.getContext().getAuthentication();
    if (null == auth) throw new AuthenticationException();
    UserToken user = (UserToken) auth.getPrincipal();
    if (null == user.getId()) throw new AuthenticationException();
    return user;
  }
View Full Code Here

Examples of sample.data.UserToken

  public void storeAuthorizedToken(String requestQuery) {

    String userId = userService.getCurrentUser().getUserId();
    String sessionToken = authService.getSessionTokenFromString(requestQuery);

    UserToken tmpUserToken = new UserToken(userId, sessionToken);
    tokenDao.storeToken(tmpUserToken);
  }
View Full Code Here

Examples of sample.data.UserToken

   * Revokes the current user's token and removes it from the data store.
   */
  public void revokeToken() {

    String userId = userService.getCurrentUser().getUserId();
    UserToken tmpUserToken = tokenDao.retrieveTokenById(userId);
    authService.revokeToken(tmpUserToken);
    tokenDao.removeTokenById(userId);
  }
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.