Package org.brickred.socialauth

Examples of org.brickred.socialauth.AuthProvider


  private void callback(final HttpServletRequest request) {
    SocialAuthManager m = socialAuthTemplate.getSocialAuthManager();
    if (m != null) {
      try {
        AuthProvider provider = m.connect(SocialAuthUtil
            .getRequestParametersMap(request));
        LOG.debug("Connected Provider : " + provider.getProviderId());
      } catch (Exception e) {
        e.printStackTrace();
      }
    } else {
      LOG.debug("Unable to connect provider because SocialAuthManager object is null.");
View Full Code Here


      List<Contact> contactsList = new ArrayList<Contact>();
      Profile profile = null;
      try {
        Map<String, String> paramsMap = SocialAuthUtil
            .getRequestParametersMap(request);
        AuthProvider provider = manager.connect(paramsMap);
        profile = provider.getUserProfile();
        contactsList = provider.getContactList();
        if (contactsList != null && contactsList.size() > 0) {
          for (Contact p : contactsList) {
            if (StringUtils.isEmpty(p.getFirstName())
                && StringUtils.isEmpty(p.getLastName())) {
              p.setFirstName(p.getDisplayName());
View Full Code Here

          return;
      }
     
      Map<String, String> paramsMap = SocialAuthUtil.getRequestParametersMap(req);
     
      AuthProvider provider;
        try {
            provider = manager.connect(paramsMap);
        } catch (Exception e) {
            throw new ScriptusRuntimeException(e);
        }

        String tokenKey = provider.getAccessGrant().getKey();
        String tokenSecret = provider.getAccessGrant().getSecret();

        TransportAccessToken twitterT = new TransportAccessToken(openid, TransportType.Twitter, tokenKey, tokenSecret);
       
        d.saveTransportAccessToken(twitterT);
       
View Full Code Here

    SocialAuthManager manager = (SocialAuthManager) session.getAttribute("openid_manager");
    if (manager == null)
      throw new SocialAuthException("Not manager found!");
    session.removeAttribute("openid_manager"); //防止重复登录的可能性
    Map<String, String> paramsMap = SocialAuthUtil.getRequestParametersMap(request);
    AuthProvider provider = manager.connect(paramsMap);
    Profile p = provider.getUserProfile();
        BasicDBObject query = new BasicDBObject().append("validatedId", p.getValidatedId()).append("provider", providerId);
        User user = dao.findOne(User.class, query);
        if (user == null) {
          user = new User();
          user.setEmail(p.getEmail());
View Full Code Here

TOP

Related Classes of org.brickred.socialauth.AuthProvider

Copyright © 2018 www.massapicom. 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.