{"action":"opened","issue":{"url":"https://api.github.com/repos/hapijs/hapi/issues/3098","repository_url":"https://api.github.com/repos/hapijs/hapi","labels_url":"https://api.github.com/repos/hapijs/hapi/issues/3098/labels{/name}","comments_url":"https://api.github.com/repos/hapijs/hapi/issues/3098/comments","events_url":"https://api.github.com/repos/hapijs/hapi/issues/3098/events","html_url":"https://github.com/hapijs/hapi/issues/3098","id":143192087,"number":3098,"title":"how to use payload for auth check ?","user":{"login":"willin","id":1890238,"avatar_url":"https://avatars.githubusercontent.com/u/1890238?v=3","gravatar_id":"","url":"https://api.github.com/users/willin","html_url":"https://github.com/willin","followers_url":"https://api.github.com/users/willin/followers","following_url":"https://api.github.com/users/willin/following{/other_user}","gists_url":"https://api.github.com/users/willin/gists{/gist_id}","starred_url":"https://api.github.com/users/willin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willin/subscriptions","organizations_url":"https://api.github.com/users/willin/orgs","repos_url":"https://api.github.com/users/willin/repos","events_url":"https://api.github.com/users/willin/events{/privacy}","received_events_url":"https://api.github.com/users/willin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-24T09:03:28Z","updated_at":"2016-03-24T09:03:28Z","closed_at":null,"body":"scheme: \r\n\r\n```\r\nscheme = {\r\n    authenticate: (request, reply) => {\r\n      return reply(null, {\r\n        credentials: {\r\n          user: {}\r\n        }\r\n      });\r\n    },\r\n    payload: (request, reply) => {\r\n      return reply.continue({\r\n        credentials: {\r\n          user: { uid: 1 }\r\n        }\r\n      });\r\n    },\r\n    options: { payload: true }\r\n  };\r\n```\r\n\r\nconfig:\r\n\r\n```\r\nserver.auth.strategy('standard', 'test',options);\r\nserver.auth.default({\r\n    strategy: 'standard',\r\n    scope: ['user'],\r\n    payload: true\r\n  });\r\n```\r\n\r\nroute:\r\n\r\n```\r\n{\r\n  method: 'post',\r\n  path: '/',\r\n  config: {\r\n    auth: {\r\n      payload: true\r\n    },\r\n    validate: {\r\n      payload: {\r\n        auth: joi.string().length(32).required().description('Auth Token')\r\n      },\r\n      failAction: (req, reply) => {\r\n        return reply(boom.unauthorized('Invalid Auth Token.'));\r\n      }\r\n    },\r\n    handler: homeHandler\r\n  }\r\n}\r\n```\r\n\r\n\r\nResult always:\r\n\r\n```\r\n{\r\n    \"credentials\": {\r\n        \"user\": {}\r\n    }\r\n}\r\n```\r\n\r\nwhy?\r\n\r\nhow to use payload for auth check ?\r\n"}}