<commit_before>/**
 * A ping federate example of how to use `hapi-auth-saml`
 */
var Hapi = require('hapi');

var port = 80;
var server = Hapi.createServer(port);

var SamlAuth = require('../lib');

var options = require('./secrets');

server.pack.register(SamlAuth, function (err) {
  var samlOptions = {
    path: options.path,
    protocol: options.protocol,
    entryPoint: options.entryPoint,
    additionalEntryPointParams: options.additionalEntryPointParams,
    cert: options.cert,
    /**
     * Check whether profile returned contains the
     * correct information
     *
     * @param  {Object}   profile
     * @param  {function(err, profile, info)} done
     * @return {function} `done` function
     */
    verifyFunc: function(profile, done) {
      // Can check profile contains the correct
      // information here
      server.log(['debug', 'verifyFunc'], profile);

      return done(null, profile);
    }
  };

  if (options.issuer) {
    samlOptions.issuer = options.issuer;
  }

  server.auth.strategy('ping', 'saml', samlOptions);


  server.route({
    method: 'GET',
    path: '/',
    config: {
      handler: function(request, reply) {
        reply("<h1>Homepage (no auth)</h1><a href='/login'>Login</a>");
      }
    }
  });

  server.route({
    method: 'GET',
    path: '/login',
    config: {
      auth: 'ping',
      handler: function(request, reply) {
        reply(request.auth.credentials);
      }
    }
  });

  server.start(function(err) {
    console.log('Server started at:', server.info.uri);
  });

});<commit_msg>Show all auth in example reply.<commit_after>/**
 * A ping federate example of how to use `hapi-auth-saml`
 */
var Hapi = require('hapi');

var port = 80;
var server = Hapi.createServer(port);

var SamlAuth = require('../lib');

var options = require('./secrets');

server.pack.register(SamlAuth, function (err) {
  var samlOptions = {
    path: options.path,
    protocol: options.protocol,
    entryPoint: options.entryPoint,
    additionalEntryPointParams: options.additionalEntryPointParams,
    cert: options.cert,
    /**
     * Check whether profile returned contains the
     * correct information
     *
     * @param  {Object}   profile
     * @param  {function(err, profile, info)} done
     * @return {function} `done` function
     */
    verifyFunc: function(profile, done) {
      // Can check profile contains the correct
      // information here
      server.log(['debug', 'verifyFunc'], profile);

      return done(null, profile);
    }
  };

  if (options.issuer) {
    samlOptions.issuer = options.issuer;
  }

  server.auth.strategy('ping', 'saml', samlOptions);


  server.route({
    method: 'GET',
    path: '/',
    config: {
      handler: function(request, reply) {
        reply("<h1>Homepage (no auth)</h1><a href='/login'>Login</a>");
      }
    }
  });

  server.route({
    method: 'GET',
    path: '/login',
    config: {
      auth: 'ping',
      handler: function(request, reply) {
        reply(request.auth);
      }
    }
  });

  server.start(function(err) {
    console.log('Server started at:', server.info.uri);
  });

});
{'fraction_non_alphanumeric': 0.1534526854219949, 'fraction_numerical': 0.0025575447570332483, 'mean_word_length': 2.778985507246377, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7454512', 'n_tokens_mistral': 999, 'n_tokens_neox': 974, 'n_words': 231}