Examples of AuthRequest


Examples of lineage2.gameserver.network.loginservercon.gspackets.AuthRequest

  {
    SocketChannel channel = (SocketChannel) key.channel();
    channel.finishConnect();
    key.interestOps(key.interestOps() & ~SelectionKey.OP_CONNECT);
    key.interestOps(key.interestOps() | SelectionKey.OP_READ);
    sendPacket(new AuthRequest());
  }
View Full Code Here

Examples of lineage2.loginserver.gameservercon.gspackets.AuthRequest

    if (!gs.isAuthed())
    {
      switch (id)
      {
        case 0x00:
          packet = new AuthRequest();
          break;
        default:
          _log.error("Received unknown packet: " + Integer.toHexString(id));
      }
    }
View Full Code Here

Examples of net.sf.l2j.gameserver.gameserverpackets.AuthRequest

            sendPacket(bfk);
            if (Config.DEBUG)_log.info("Sent new blowfish key");
            //now, only accept paket with the new encryption
            _blowfish = new NewCrypt(_blowfishKey);
            if (Config.DEBUG)_log.info("Changed blowfish key");
            AuthRequest ar = new AuthRequest(_requestID, _acceptAlternate, _hexID, _gameExternalHost, _gameInternalHost, _gamePort, _reserveHost, _maxPlayer);
            sendPacket(ar);
            if (Config.DEBUG)_log.info("Sent AuthRequest to login");
            break;
          case 01:
            LoginServerFail lsf = new LoginServerFail(decrypt);
View Full Code Here

Examples of org.apache.manifoldcf.authorities.system.AuthRequest

        String identifyingString = thisConnection.getDescription();
        if (identifyingString == null || identifyingString.length() == 0)
          identifyingString = thisConnection.getName();
       
        // Create a request
        AuthRequest ar = new AuthRequest(
          thisConnection.getClassName(),identifyingString,thisConnection.getConfigParams(),thisConnection.getMaxConnections());
        authRequests.put(thisConnection.getName(), ar);
       
        // We create an auth thread if there are prerequisites to meet.
        // Otherwise, we just fire off the request
        if (thisConnection.getPrerequisiteMapping() == null)
        {
          ar.setUserID(userID);
          queue.addRequest(ar);
        }
        else
        {
          AuthOrderThread thread = new AuthOrderThread(identifyingString,
            ar, thisConnection.getPrerequisiteMapping(),
            queue, mappingRequests);
          authThreads.add(thread);
          activeConnections.add(thisConnection.getPrerequisiteMapping());
        }
      }

      // Create mapping requests
      while (!activeConnections.isEmpty())
      {
        Iterator<String> connectionIter = activeConnections.iterator();
        String connectionName = connectionIter.next();
        IMappingConnection thisConnection = mappingConnMap.get(connectionName);
        String identifyingString = thisConnection.getDescription();
        if (identifyingString == null || identifyingString.length() == 0)
          identifyingString = connectionName;

        // Create a request
        MappingRequest mr = new MappingRequest(
          thisConnection.getClassName(),identifyingString,thisConnection.getConfigParams(),thisConnection.getMaxConnections());
        mappingRequests.put(connectionName, mr);

        // Either start up a thread, or just fire it off immediately.
        if (thisConnection.getPrerequisiteMapping() == null)
        {
          mr.setUserID(userID);
          mappingQueue.addRequest(mr);
        }
        else
        {
          //System.out.println("Mapper: prerequisite found: '"+thisConnection.getPrerequisiteMapping()+"'");
          MappingOrderThread thread = new MappingOrderThread(identifyingString,
            mr, thisConnection.getPrerequisiteMapping(), mappingQueue, mappingRequests);
          mappingThreads.add(thread);
          String p = thisConnection.getPrerequisiteMapping();
          if (mappingRequests.get(p) == null)
            activeConnections.add(p);
        }
        activeConnections.remove(connectionName);
      }
     
      // Start threads.  We have to wait until all the requests have been
      // at least created before we do this.
      for (MappingOrderThread thread : mappingThreads)
      {
        thread.start();
      }
      for (AuthOrderThread thread : authThreads)
      {
        thread.start();
      }
     
      // Wait for the threads to finish up.  This will guarantee that all entities have run to completion.
      for (MappingOrderThread thread : mappingThreads)
      {
        thread.finishUp();
      }
      for (AuthOrderThread thread : authThreads)
      {
        thread.finishUp();
      }
     
      // This is probably unnecessary, but we do it anyway just to adhere to the contract
      for (MappingRequest mr : mappingRequests.values())
      {
        mr.waitForComplete();
      }
     
      // Handle all exceptions thrown during mapping.  In general this just means logging them, because
      // the downstream authorities will presumably not find what they are looking for and error out that way.
      for (MappingRequest mr : mappingRequests.values())
      {
        Throwable exception = mr.getAnswerException();
        if (exception != null)
        {
          Logging.authorityService.warn("Mapping exception logged from "+mr.getIdentifyingString()+": "+exception.getMessage()+"; mapper aborted", exception);
        }
      }
     
      // Now, work through the returning answers.

      // Ask all the registered authorities for their ACLs, and merge the final list together.
      StringBuilder sb = new StringBuilder();
      // Set response mime type
      response.setContentType("text/plain; charset=ISO8859-1");
      ServletOutputStream out = response.getOutputStream();
      try
      {
        for (int i = 0; i < connections.length; i++)
        {
          IAuthorityConnection ac = connections[i];
          AuthRequest ar = authRequests.get(ac.getName());

          if (Logging.authorityService.isDebugEnabled())
            Logging.authorityService.debug("Waiting for answer from connector class '"+ac.getClassName()+"' for user '"+userID+"'");

          ar.waitForComplete();

          if (Logging.authorityService.isDebugEnabled())
            Logging.authorityService.debug("Received answer from connector class '"+ac.getClassName()+"' for user '"+userID+"'");

          Throwable exception = ar.getAnswerException();
          AuthorizationResponse reply = ar.getAnswerResponse();
          if (exception != null)
          {
            // Exceptions are always bad now
            // The ManifoldCFException here must disable access to the UI without causing a generic badness thing to happen, so use 403.
            if (exception instanceof ManifoldCFException)
              response.sendError(response.SC_FORBIDDEN,"From "+ar.getIdentifyingString()+": "+exception.getMessage());
            else
              response.sendError(response.SC_INTERNAL_SERVER_ERROR,"From "+ar.getIdentifyingString()+": "+exception.getMessage());
            return;
          }

          // A null reply means the same as USERNOTFOUND; it occurs because a user mapping failed somewhere.
          if (reply == null)
          {
            if (Logging.authorityService.isDebugEnabled())
              Logging.authorityService.debug("User '"+userID+"' mapping failed for authority '"+ar.getIdentifyingString()+"'");
            sb.append(USERNOTFOUND_VALUE).append(java.net.URLEncoder.encode(ar.getIdentifyingString(),"UTF-8")).append("\n");
          }
          else if (reply.getResponseStatus() == AuthorizationResponse.RESPONSE_UNREACHABLE)
          {
            Logging.authorityService.warn("Authority '"+ar.getIdentifyingString()+"' is unreachable for user '"+userID+"'");
            sb.append(UNREACHABLE_VALUE).append(java.net.URLEncoder.encode(ar.getIdentifyingString(),"UTF-8")).append("\n");
          }
          else if (reply.getResponseStatus() == AuthorizationResponse.RESPONSE_USERUNAUTHORIZED)
          {
            if (Logging.authorityService.isDebugEnabled())
              Logging.authorityService.debug("Authority '"+ar.getIdentifyingString()+"' does not authorize user '"+userID+"'");
            sb.append(UNAUTHORIZED_VALUE).append(java.net.URLEncoder.encode(ar.getIdentifyingString(),"UTF-8")).append("\n");
          }
          else if (reply.getResponseStatus() == AuthorizationResponse.RESPONSE_USERNOTFOUND)
          {
            if (Logging.authorityService.isDebugEnabled())
              Logging.authorityService.debug("User '"+userID+"' unknown to authority '"+ar.getIdentifyingString()+"'");
            sb.append(USERNOTFOUND_VALUE).append(java.net.URLEncoder.encode(ar.getIdentifyingString(),"UTF-8")).append("\n");
          }
          else
            sb.append(AUTHORIZED_VALUE).append(java.net.URLEncoder.encode(ar.getIdentifyingString(),"UTF-8")).append("\n");

          String[] acl = reply.getAccessTokens();
          if (acl != null)
          {
            if (aclneeded)
            {
              int j = 0;
              while (j < acl.length)
              {
                if (Logging.authorityService.isDebugEnabled())
                  Logging.authorityService.debug("  User '"+userID+"' has Acl = '"+acl[j]+"' from authority '"+ar.getIdentifyingString()+"'");
                sb.append(TOKEN_PREFIX).append(java.net.URLEncoder.encode(ac.getName(),"UTF-8")).append(":").append(java.net.URLEncoder.encode(acl[j++],"UTF-8")).append("\n");
              }
            }
          }
        }
View Full Code Here

Examples of org.apache.manifoldcf.authorities.system.AuthRequest

          String identifyingString = thisConnection.getDescription();
          if (identifyingString == null || identifyingString.length() == 0)
            identifyingString = thisConnection.getName();
         
          // Create a request
          AuthRequest ar = new AuthRequest(thisConnection,identifyingString);
          authRequests.put(thisConnection.getName(), ar);
         
          // We create an auth thread if there are prerequisites to meet.
          // Otherwise, we just fire off the request
          String domainUserID = domainMap.get(authDomain);
          if (thisConnection.getPrerequisiteMapping() == null)
          {
            ar.setUserID(domainUserID);
            queue.addRequest(ar);
          }
          else
          {
            MapperDescription md = new MapperDescription(thisConnection.getPrerequisiteMapping(),authDomain);
            AuthOrderThread thread = new AuthOrderThread(identifyingString,
              ar, md,
              queue, mappingRequests);
            authThreads.add(thread);
            // The same mapper can be used for multiple domains, although this is likely to be uncommon.  Nevertheless,
            // mapper invocations need to be segregated to prevent trouble
            activeConnections.add(md);
          }
        }
      }

      // Create mapping requests
      while (!activeConnections.isEmpty())
      {
        Iterator<MapperDescription> connectionIter = activeConnections.iterator();
        MapperDescription mapperDesc = connectionIter.next();
        String connectionName = mapperDesc.mapperName;
        String authDomain = mapperDesc.authDomain;
        IMappingConnection thisConnection = mappingConnMap.get(connectionName);
        String identifyingString = thisConnection.getDescription();
        if (identifyingString == null || identifyingString.length() == 0)
          identifyingString = connectionName;

        // Create a request
        MappingRequest mr = new MappingRequest(thisConnection,identifyingString);
        mappingRequests.put(mapperDesc, mr);

        // Either start up a thread, or just fire it off immediately.
        if (thisConnection.getPrerequisiteMapping() == null)
        {
          mr.setUserID(domainMap.get(authDomain));
          mappingQueue.addRequest(mr);
        }
        else
        {
          //System.out.println("Mapper: prerequisite found: '"+thisConnection.getPrerequisiteMapping()+"'");
          MapperDescription p = new MapperDescription(thisConnection.getPrerequisiteMapping(),authDomain);
          MappingOrderThread thread = new MappingOrderThread(identifyingString,
            mr, p, mappingQueue, mappingRequests);
          mappingThreads.add(thread);
          if (mappingRequests.get(p) == null)
            activeConnections.add(p);
        }
        activeConnections.remove(mapperDesc);
      }
     
      // Start threads.  We have to wait until all the requests have been
      // at least created before we do this.
      for (MappingOrderThread thread : mappingThreads)
      {
        thread.start();
      }
      for (AuthOrderThread thread : authThreads)
      {
        thread.start();
      }
     
      // Wait for the threads to finish up.  This will guarantee that all entities have run to completion.
      for (MappingOrderThread thread : mappingThreads)
      {
        thread.finishUp();
      }
      for (AuthOrderThread thread : authThreads)
      {
        thread.finishUp();
      }
     
      // This is probably unnecessary, but we do it anyway just to adhere to the contract
      for (MappingRequest mr : mappingRequests.values())
      {
        mr.waitForComplete();
      }
     
      // Handle all exceptions thrown during mapping.  In general this just means logging them, because
      // the downstream authorities will presumably not find what they are looking for and error out that way.
      for (MappingRequest mr : mappingRequests.values())
      {
        Throwable exception = mr.getAnswerException();
        if (exception != null)
        {
          Logging.authorityService.warn("Mapping exception logged from "+mr.getIdentifyingString()+": "+exception.getMessage()+"; mapper aborted", exception);
        }
      }
     
      // Now, work through the returning answers.

      // Ask all the interrogated authorities for their ACLs, and merge the final list together.
      StringBuilder sb = new StringBuilder();
      // Set response mime type
      response.setContentType("text/plain; charset=ISO8859-1");
      ServletOutputStream out = response.getOutputStream();
      try
      {
        for (String connectionName : authRequests.keySet())
        {
          AuthRequest ar = authRequests.get(connectionName);

          if (Logging.authorityService.isDebugEnabled())
            Logging.authorityService.debug("Waiting for answer from authority connection "+ar.getIdentifyingString()+" for user '"+ar.getUserID()+"'");

          ar.waitForComplete();

          if (Logging.authorityService.isDebugEnabled())
            Logging.authorityService.debug("Received answer from authority connection "+ar.getIdentifyingString()+" for user '"+ar.getUserID()+"'");

          Throwable exception = ar.getAnswerException();
          AuthorizationResponse reply = ar.getAnswerResponse();
          if (exception != null)
          {
            // Exceptions are always bad now
            // The ManifoldCFException here must disable access to the UI without causing a generic badness thing to happen, so use 403.
            if (exception instanceof ManifoldCFException)
              response.sendError(response.SC_FORBIDDEN,"From "+ar.getIdentifyingString()+": "+exception.getMessage());
            else
              response.sendError(response.SC_INTERNAL_SERVER_ERROR,"From "+ar.getIdentifyingString()+": "+exception.getMessage());
            return;
          }

          String authGroup = ar.getAuthorityConnection().getAuthGroup();
         
          // A null reply means the same as USERNOTFOUND; it occurs because a user mapping failed somewhere.
          if (reply == null)
          {
            if (Logging.authorityService.isDebugEnabled())
              Logging.authorityService.debug("User '"+ar.getUserID()+"' mapping failed for authority '"+ar.getIdentifyingString()+"'");
            sb.append(USERNOTFOUND_VALUE).append(java.net.URLEncoder.encode(ar.getIdentifyingString(),"UTF-8")).append("\n");
          }
          else if (reply.getResponseStatus() == AuthorizationResponse.RESPONSE_UNREACHABLE)
          {
            Logging.authorityService.warn("Authority '"+ar.getIdentifyingString()+"' is unreachable for user '"+ar.getUserID()+"'");
            sb.append(UNREACHABLE_VALUE).append(java.net.URLEncoder.encode(ar.getIdentifyingString(),"UTF-8")).append("\n");
          }
          else if (reply.getResponseStatus() == AuthorizationResponse.RESPONSE_USERUNAUTHORIZED)
          {
            if (Logging.authorityService.isDebugEnabled())
              Logging.authorityService.debug("Authority '"+ar.getIdentifyingString()+"' does not authorize user '"+ar.getUserID()+"'");
            sb.append(UNAUTHORIZED_VALUE).append(java.net.URLEncoder.encode(ar.getIdentifyingString(),"UTF-8")).append("\n");
          }
          else if (reply.getResponseStatus() == AuthorizationResponse.RESPONSE_USERNOTFOUND)
          {
            if (Logging.authorityService.isDebugEnabled())
              Logging.authorityService.debug("User '"+ar.getUserID()+"' unknown to authority '"+ar.getIdentifyingString()+"'");
            sb.append(USERNOTFOUND_VALUE).append(java.net.URLEncoder.encode(ar.getIdentifyingString(),"UTF-8")).append("\n");
          }
          else
            sb.append(AUTHORIZED_VALUE).append(java.net.URLEncoder.encode(ar.getIdentifyingString(),"UTF-8")).append("\n");

          String[] acl = reply.getAccessTokens();
          if (acl != null)
          {
            if (aclneeded)
            {
              int j = 0;
              while (j < acl.length)
              {
                if (Logging.authorityService.isDebugEnabled())
                  Logging.authorityService.debug("  User '"+ar.getUserID()+"' has Acl = '"+acl[j]+"' from authority '"+ar.getIdentifyingString()+"'");
                sb.append(TOKEN_PREFIX).append(java.net.URLEncoder.encode(authGroup,"UTF-8")).append(":").append(java.net.URLEncoder.encode(acl[j++],"UTF-8")).append("\n");
              }
            }
          }
        }
View Full Code Here

Examples of org.apache.manifoldcf.authorities.system.AuthRequest

        String identifyingString = ac.getDescription();
        if (identifyingString == null || identifyingString.length() == 0)
          identifyingString = ac.getName();

        AuthRequest ar = new AuthRequest(userID,ac.getClassName(),identifyingString,ac.getConfigParams(),ac.getMaxConnections());
        queue.addRequest(ar);

        requests[i++] = ar;
      }

      // Now, work through the returning answers.
      i = 0;

      // Ask all the registered authorities for their ACLs, and merge the final list together.
      StringBuilder sb = new StringBuilder();
      // Set response mime type
      response.setContentType("text/plain; charset=ISO8859-1");
      ServletOutputStream out = response.getOutputStream();
      try
      {
        while (i < connections.length)
        {
          IAuthorityConnection ac = connections[i];
          AuthRequest ar = requests[i++];

          if (Logging.authorityService.isDebugEnabled())
            Logging.authorityService.debug("Waiting for answer from connector class '"+ac.getClassName()+"' for user '"+userID+"'");

          ar.waitForComplete();

          if (Logging.authorityService.isDebugEnabled())
            Logging.authorityService.debug("Received answer from connector class '"+ac.getClassName()+"' for user '"+userID+"'");

          Throwable exception = ar.getAnswerException();
          AuthorizationResponse reply = ar.getAnswerResponse();
          if (exception != null)
          {
            // Exceptions are always bad now
            // The ManifoldCFException here must disable access to the UI without causing a generic badness thing to happen, so use 403.
            if (exception instanceof ManifoldCFException)
              response.sendError(response.SC_FORBIDDEN,"From "+ar.getIdentifyingString()+": "+exception.getMessage());
            else
              response.sendError(response.SC_INTERNAL_SERVER_ERROR,"From "+ar.getIdentifyingString()+": "+exception.getMessage());
            return;
          }

          if (reply.getResponseStatus() == AuthorizationResponse.RESPONSE_UNREACHABLE)
          {
            Logging.authorityService.warn("Authority '"+ar.getIdentifyingString()+"' is unreachable for user '"+userID+"'");
            sb.append(UNREACHABLE_VALUE).append(java.net.URLEncoder.encode(ar.getIdentifyingString(),"UTF-8")).append("\n");
          }
          else if (reply.getResponseStatus() == AuthorizationResponse.RESPONSE_USERUNAUTHORIZED)
          {
            if (Logging.authorityService.isDebugEnabled())
              Logging.authorityService.debug("Authority '"+ar.getIdentifyingString()+"' does not authorize user '"+userID+"'");
            sb.append(UNAUTHORIZED_VALUE).append(java.net.URLEncoder.encode(ar.getIdentifyingString(),"UTF-8")).append("\n");
          }
          else if (reply.getResponseStatus() == AuthorizationResponse.RESPONSE_USERNOTFOUND)
          {
            if (Logging.authorityService.isDebugEnabled())
              Logging.authorityService.debug("User '"+userID+"' unknown to authority '"+ar.getIdentifyingString()+"'");
            sb.append(USERNOTFOUND_VALUE).append(java.net.URLEncoder.encode(ar.getIdentifyingString(),"UTF-8")).append("\n");
          }
          else
            sb.append(AUTHORIZED_VALUE).append(java.net.URLEncoder.encode(ar.getIdentifyingString(),"UTF-8")).append("\n");

          String[] acl = reply.getAccessTokens();
          if (acl != null)
          {
            if (aclneeded)
            {
              int j = 0;
              while (j < acl.length)
              {
                if (Logging.authorityService.isDebugEnabled())
                  Logging.authorityService.debug("  User '"+userID+"' has Acl = '"+acl[j]+"' from authority '"+ar.getIdentifyingString()+"'");
                sb.append(TOKEN_PREFIX).append(java.net.URLEncoder.encode(ac.getName(),"UTF-8")).append(":").append(java.net.URLEncoder.encode(acl[j++],"UTF-8")).append("\n");
              }
            }
          }
        }
View Full Code Here

Examples of org.apache.manifoldcf.authorities.system.AuthRequest

        String identifyingString = ac.getDescription();
        if (identifyingString == null || identifyingString.length() == 0)
          identifyingString = ac.getName();

        AuthRequest ar = new AuthRequest(userID,ac.getClassName(),identifyingString,ac.getConfigParams(),ac.getMaxConnections());
        queue.addRequest(ar);

        requests[i++] = ar;
      }

      // Now, work through the returning answers.
      i = 0;

      // Ask all the registered authorities for their ACLs, and merge the final list together.
      StringBuilder sb = new StringBuilder();
      // Set response mime type
      response.setContentType("text/plain; charset=ISO8859-1");
      ServletOutputStream out = response.getOutputStream();
      try
      {
        while (i < connections.length)
        {
          IAuthorityConnection ac = connections[i];
          AuthRequest ar = requests[i++];

          if (Logging.authorityService.isDebugEnabled())
            Logging.authorityService.debug("Waiting for answer from connector class '"+ac.getClassName()+"' for user '"+userID+"'");

          ar.waitForComplete();

          if (Logging.authorityService.isDebugEnabled())
            Logging.authorityService.debug("Received answer from connector class '"+ac.getClassName()+"' for user '"+userID+"'");

          Throwable exception = ar.getAnswerException();
          AuthorizationResponse reply = ar.getAnswerResponse();
          if (exception != null)
          {
            // Exceptions are always bad now
            // The ManifoldCFException here must disable access to the UI without causing a generic badness thing to happen, so use 403.
            if (exception instanceof ManifoldCFException)
              response.sendError(response.SC_FORBIDDEN,"From "+ar.getIdentifyingString()+": "+exception.getMessage());
            else
              response.sendError(response.SC_INTERNAL_SERVER_ERROR,"From "+ar.getIdentifyingString()+": "+exception.getMessage());
            return;
          }

          if (reply.getResponseStatus() == AuthorizationResponse.RESPONSE_UNREACHABLE)
          {
            Logging.authorityService.warn("Authority '"+ar.getIdentifyingString()+"' is unreachable for user '"+userID+"'");
            sb.append(UNREACHABLE_VALUE).append(java.net.URLEncoder.encode(ar.getIdentifyingString(),"UTF-8")).append("\n");
          }
          else if (reply.getResponseStatus() == AuthorizationResponse.RESPONSE_USERUNAUTHORIZED)
          {
            if (Logging.authorityService.isDebugEnabled())
              Logging.authorityService.debug("Authority '"+ar.getIdentifyingString()+"' does not authorize user '"+userID+"'");
            sb.append(UNAUTHORIZED_VALUE).append(java.net.URLEncoder.encode(ar.getIdentifyingString(),"UTF-8")).append("\n");
          }
          else if (reply.getResponseStatus() == AuthorizationResponse.RESPONSE_USERNOTFOUND)
          {
            if (Logging.authorityService.isDebugEnabled())
              Logging.authorityService.debug("User '"+userID+"' unknown to authority '"+ar.getIdentifyingString()+"'");
            sb.append(USERNOTFOUND_VALUE).append(java.net.URLEncoder.encode(ar.getIdentifyingString(),"UTF-8")).append("\n");
          }
          else
            sb.append(AUTHORIZED_VALUE).append(java.net.URLEncoder.encode(ar.getIdentifyingString(),"UTF-8")).append("\n");

          String[] acl = reply.getAccessTokens();
          if (acl != null)
          {
            if (aclneeded)
            {
              int j = 0;
              while (j < acl.length)
              {
                if (Logging.authorityService.isDebugEnabled())
                  Logging.authorityService.debug("  User '"+userID+"' has Acl = '"+acl[j]+"' from authority '"+ar.getIdentifyingString()+"'");
                sb.append(TOKEN_PREFIX).append(java.net.URLEncoder.encode(ac.getName(),"UTF-8")).append(":").append(java.net.URLEncoder.encode(acl[j++],"UTF-8")).append("\n");
              }
            }
          }
        }
View Full Code Here

Examples of org.keycloak.social.AuthRequest

        String secret = realm.getSocialConfig().get(socialProviderId + ".secret");
        String callbackUri = Urls.socialCallback(uriInfo.getBaseUri()).toString();
        SocialProviderConfig config = new SocialProviderConfig(key, secret, callbackUri);


        AuthRequest authRequest = socialProvider.getAuthUrl(code.getClientSession(), config, code.getCode());
        return Response.status(302).location(authRequest.getAuthUri()).build();
    }
View Full Code Here

Examples of org.openid4java.message.AuthRequest

                " OP-specific ID: " + delegate);

        if (! discovered.isVersion2())
            returnToUrl = insertConsumerNonce(discovered.getOPEndpoint().toString(), returnToUrl);

        AuthRequest authReq = AuthRequest.createAuthRequest(claimedId, delegate,
                ! discovered.isVersion2(), returnToUrl, handle, realm, _realmVerifier);

        authReq.setOPEndpoint(discovered.getOPEndpoint());

        // ignore the immediate flag for OP-directed identifier selection
        if (! AuthRequest.SELECT_ID.equals(claimedId))
            authReq.setImmediate(_immediateAuth);

        return authReq;
    }
View Full Code Here

Examples of org.openid4java.message.AuthRequest

      // store the discovery information in the user's session
      httpReq.getSession().setAttribute("openid-disc", discovered);

      // obtain a AuthRequest message to be sent to the OpenID provider
      AuthRequest authReq = manager.authenticate(discovered, returnToUrl);

      // Simple registration example
      addSimpleRegistrationToAuthRequest(httpReq, authReq);

      // Attribute exchange example
      addAttributeExchangeToAuthRequest(httpReq, authReq);

      if (!discovered.isVersion2()) {
        // Option 1: GET HTTP-redirect to the OpenID Provider endpoint
        // The only method supported in OpenID 1.x
        // redirect-URL usually limited ~2048 bytes
        httpResp.sendRedirect(authReq.getDestinationUrl(true));
        return null;
      } else {
        // Option 2: HTML FORM Redirection (Allows payloads >2048 bytes)

        RequestDispatcher dispatcher = getServletContext()
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.