Package org.ietf.jgss

Examples of org.ietf.jgss.GSSContext.dispose()


                context.initSecContext( Strings.EMPTY_BYTES, 0, 0 );

                // byte[] outToken = context.initSecContext( Strings.EMPTY_BYTES, 0, 0 );
                // System.out.println(new BASE64Encoder().encode(outToken));
                context.dispose();

                return null;
            }
            catch ( GSSException gsse )
            {
View Full Code Here


            response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
            return false;
        } finally {
            if (gssContext != null) {
                try {
                    gssContext.dispose();
                } catch (GSSException e) {
                    // Ignore
                }
            }
            if (lc != null) {
View Full Code Here

                        }

                        if (!context.getMutualAuthState()) {
                            throw new IOException("Authentication Handshake Failed");
                        }
                        context.dispose();
                        context = null;
                    } catch (GSSException ex) {
                        Throwables.propagate(ex);
                    } catch (IOException ex) {
                        Throwables.propagate(ex);
View Full Code Here

                    } catch (GSSException ex) {
                        Throwables.propagate(ex);
                    } catch (IOException ex) {
                        Throwables.propagate(ex);
                    } finally {
                        if (context != null) try { context.dispose(); } catch (Exception ignoreIt) {}
                    }
                    return null;
                }
            });
        } catch (SecurityException ex) {
View Full Code Here

                        // check if both ends are authenticated
                        if (!context.getMutualAuthState()) {
                            return null;
                        }
                        context.dispose();
                        context = null;

                        return authenticateUserName;

                    } catch (IOException|GSSException ex) {
View Full Code Here

                        return authenticateUserName;

                    } catch (IOException|GSSException ex) {
                        Throwables.propagate(ex);
                    } finally {
                        if (context != null) try { context.dispose(); } catch (Exception ignoreIt) {}
                    }
                    return null;
                }
            });
View Full Code Here

             */
            if (spnegoGenerator != null && negotiationOid.toString().equals(KERBEROS_OID)) {
                token = spnegoGenerator.generateSpnegoDERObject(token);
            }

            gssContext.dispose();

            String tokenstr = new String(Base64.encode(token));
            log.debug("Sending response '{}' back to the server", tokenstr);

            return tokenstr;
View Full Code Here

            response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
            return false;
        } finally {
            if (gssContext != null) {
                try {
                    gssContext.dispose();
                } catch (GSSException e) {
                    // Ignore
                }
            }
            if (lc != null) {
View Full Code Here

        throw new HttpAuthenticationException("Kerberos authentication failed: ", e);
      }
      finally {
        if (gssContext != null) {
          try {
            gssContext.dispose();
          } catch (GSSException e) {
            // No-op
          }
        }
      }
View Full Code Here

      byte[] inToken = new byte[0];
      byte[] outToken;

      outToken = gssContext.initSecContext(inToken, 0, inToken.length);

      gssContext.dispose();
      // Base64 encoded and stringified token for server
      String authHeaderBase64String = new String(base64codec.encode(outToken));
      return authHeaderBase64String;
    }
  }
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.