Examples of DigestCredentials


Examples of com.caucho.security.DigestCredentials

        SecurityService security = SecurityService.getCurrent();
       
        if ("".equals(uid))
          credentials = new SignedCredentials(uid, serverNonce, signature);
        else
          credentials = new DigestCredentials(uid, serverNonce, signature);
        /*
        else if (security != null)
          credentials = security.createCredentials(uid, password, serverNonce);
        else {
          security = new SecurityService();
View Full Code Here

Examples of com.caucho.security.DigestCredentials

     
      throw new NotAuthorizedException(L.l("'{0}' has missing authenticator",
                                           credentials));
    }
    else if (credentials instanceof DigestCredentials) {
      DigestCredentials digestCred = (DigestCredentials) credentials;

      Principal user = new BasicPrincipal(digestCred.getUserName());
     
      user = auth.authenticate(user, digestCred, null);

      if (user == null) {
        throw new NotAuthorizedException(L.l("'{0}' has invalid digest credentials",
                                             digestCred.getUserName()));
      }
    }
    else if (credentials instanceof String) {
      String password = (String) credentials;
   
View Full Code Here

Examples of com.sun.enterprise.security.auth.login.DigestCredentials

                    logger.log(Level.FINE, "Realm in the message does not match with configured realm");
                }
                return null;
            }

            DigestCredentials creds = new DigestCredentials(realmName,
                    key.getUsername(), params);

            LoginContextDriver.login(creds);

            if (nc != null && nc.length() > 0) {
                nextNonce = "00000001";
            }


            authInfoHeader = createAuthInfoHeader(request, nextNonce);
            SecurityContext secCtx = SecurityContext.getCurrent();

            return new WebPrincipal(creds.getUserName(), null, secCtx);
        } catch (Exception le) {
            logger.log(Level.SEVERE, "Digest Authentication failed", le);

        //TODO: Log
        }
View Full Code Here

Examples of com.sun.enterprise.security.auth.login.DigestCredentials

                key = (Key)dap;
                break;
              }
            }

           DigestCredentials creds = new DigestCredentials(_realmName,key.getUsername(), params);    
           LoginContextDriver.login(creds);
           SecurityContext secCtx = SecurityContext.getCurrent();
           return new WebPrincipal(creds.getUserName(), null, secCtx);

       } catch (Exception le) {
           if (_logger.isLoggable(Level.WARNING)) {
               _logger.warning("Web login failed: " + le.getMessage());
            }
View Full Code Here

Examples of com.sun.enterprise.security.auth.login.DigestCredentials

                    break;
                }
            }

           if (key != null) {
               DigestCredentials creds = new DigestCredentials(_realmName,key.getUsername(), params);    
               LoginContextDriver.login(creds);
               SecurityContext secCtx = SecurityContext.getCurrent();
               return new WebPrincipal(creds.getUserName(),(char[])null, secCtx);
           } else {
               throw new RuntimeException("No key found in parameters");
           }

       } catch (Exception le) {
View Full Code Here

Examples of com.sun.enterprise.security.auth.login.DigestCredentials

                    break;
                }
            }

           if (key != null) {
               DigestCredentials creds = new DigestCredentials(_realmName,key.getUsername(), params);    
               LoginContextDriver.login(creds);
               SecurityContext secCtx = SecurityContext.getCurrent();
               return new WebPrincipal(creds.getUserName(),(char[])null, secCtx);
           } else {
               throw new RuntimeException("No key found in parameters");
           }

       } catch (Exception le) {
View Full Code Here

Examples of com.sun.enterprise.security.auth.login.DigestCredentials

                    break;
                }
            }

           if (key != null) {
               DigestCredentials creds = new DigestCredentials(_realmName,key.getUsername(), params);    
               LoginContextDriver.login(creds);
               SecurityContext secCtx = SecurityContext.getCurrent();
               return new WebPrincipal(creds.getUserName(),(char[])null, secCtx);
           } else {
               throw new RuntimeException("No key found in parameters");
           }

       } catch (Exception le) {
View Full Code Here

Examples of com.sun.enterprise.security.auth.login.DigestCredentials

                    break;
                }
            }

           if (key != null) {
               DigestCredentials creds = new DigestCredentials(_realmName,key.getUsername(), params);    
               LoginContextDriver.login(creds);
               SecurityContext secCtx = SecurityContext.getCurrent();
               return new WebPrincipal(creds.getUserName(),(char[])null, secCtx);
           } else {
               throw new RuntimeException("No key found in parameters");
           }

       } catch (Exception le) {
View Full Code Here

Examples of com.sun.enterprise.security.auth.login.DigestCredentials

                    break;
                }
            }

           if (key != null) {
               DigestCredentials creds = new DigestCredentials(_realmName,key.getUsername(), params);    
               LoginContextDriver.login(creds);
               SecurityContext secCtx = SecurityContext.getCurrent();
               return new WebPrincipal(creds.getUserName(),(char[])null, secCtx);
           } else {
               throw new RuntimeException("No key found in parameters");
           }

       } catch (Exception le) {
View Full Code Here

Examples of com.sun.enterprise.security.auth.login.DigestCredentials

                    break;
                }
            }

           if (key != null) {
               DigestCredentials creds = new DigestCredentials(_realmName,key.getUsername(), params);    
               LoginContextDriver.login(creds);
               SecurityContext secCtx = SecurityContext.getCurrent();
               return new WebPrincipal(creds.getUserName(),(char[])null, secCtx);
           } else {
               throw new RuntimeException("No key found in parameters");
           }

       } catch (Exception le) {
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.