SlideShare a Scribd company logo
Developing	
  with	
  OAuth	
  and	
  OpenID	
  
Connect	
  
David	
  Chase	
  
Senior	
  So9ware	
  Architect	
  
Ping	
  Iden;ty	
  
Ques;ons	
  please!	
  
OAuth	
  or	
  OpenID	
  Connect,	
  which	
  one?	
  
OAuth2.0	
  
•  An	
  authoriza;on	
  grant	
  is	
  a	
  creden;al	
  
represen;ng	
  the	
  resource	
  owner's	
  
authoriza;on	
  to	
  access	
  its	
  protected	
  
resources.	
  
OpenID	
  Connect	
  
•  OpenID	
  Connect	
  1.0	
  is	
  a	
  simple	
  iden;ty	
  layer	
  on	
  
top	
  of	
  the	
  OAuth	
  2.0	
  [RFC6749]	
  protocol.	
  It	
  
enables	
  Clients	
  to	
  verify	
  the	
  iden;ty	
  of	
  the	
  End-­‐
User	
  based	
  on	
  the	
  authen;ca;on	
  performed	
  by	
  
an	
  Authoriza;on	
  Server,	
  as	
  well	
  as	
  to	
  obtain	
  basic	
  
profile	
  informa;on	
  about	
  the	
  End-­‐User	
  in	
  an	
  
interoperable	
  and	
  REST-­‐like	
  manner.	
  
OAuth	
  or	
  OpenID	
  Connect,	
  which	
  one?	
  
•  OAuth	
  is	
  for	
  authoriza;on	
  
•  OpenID	
  Connects	
  adds	
  authen;ca;on	
  to	
  
authoriza;on	
  
Choosing	
  a	
  Grant	
  Type	
  for	
  OAuth	
  
•  Authoriza;on	
  Code	
  	
  
•  Implicit	
  
•  Resource	
  Owner	
  Creden;als	
  	
  
•  Refresh	
  Token	
  	
  
•  Client	
  Creden;als	
  	
  
•  Extension	
  (i.e.	
  SAML	
  2.0	
  Bearer)	
  
Authoriza;on	
  Code	
  	
  
var	
  reques;fy	
  =	
  require('reques;fy');	
  
	
  	
  	
  	
  reques;fy.post('hbp://example.com',	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  redirect_uri:	
  'hbps%3A%2F%2Fexample.org%2callback',	
  
	
  response_type:'code',	
  
	
  client_id:'myId’,	
  
	
  scope:’read’,	
  
	
  state:’343msdjasd9k2’	
  
	
  	
  	
  	
  })	
  
	
  	
  	
  	
  .then(func;on(response)	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  //	
  Get	
  the	
  response	
  body	
  (JSON	
  parsed	
  or	
  jQuery	
  object	
  for	
  XMLs)	
  
	
  	
  	
  	
  	
  	
  	
  	
  response.getBody();	
  
	
  	
  	
  	
  });	
  
Implicit	
  
var	
  reques;fy	
  =	
  require('reques;fy');	
  
	
  	
  	
  	
  reques;fy.post('hbp://example.com',	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  redirect_uri:	
  'hbps%3A%2F%2Fexample.org%2callback',	
  
	
  response_type:’token',	
  
	
  client_id:'myId’,	
  
	
  scope:’read’,	
  
	
  state:’343msdjasd9k2’	
  
	
  	
  	
  	
  })	
  
	
  	
  	
  	
  .then(func;on(response)	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  //	
  Get	
  the	
  response	
  body	
  (JSON	
  parsed	
  or	
  jQuery	
  object	
  for	
  XMLs)	
  
	
  	
  	
  	
  	
  	
  	
  	
  response.getBody();	
  
	
  	
  	
  	
  });	
  
Resource	
  Owner	
  Creden;als	
  	
  
var	
  reques;fy	
  =	
  require('reques;fy');	
  
	
  	
  	
  	
  reques;fy.post('hbp://example.com',	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  redirect_uri:	
  'hbps%3A%2F%2Fexample.org%2callback',	
  
	
  grant_type:’password',	
  
	
  username:’joe’,	
  
	
  password:’2Federate’,	
  
	
  client_id:'myId’,	
  
	
  scope:’read’,	
  
})	
  
	
  	
  	
  	
  .then(func;on(response)	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  //	
  Get	
  the	
  response	
  body	
  (JSON	
  parsed	
  or	
  jQuery	
  object	
  for	
  XMLs)	
  
	
  	
  	
  	
  	
  	
  	
  	
  response.getBody();	
  
	
  	
  	
  	
  });	
  
Refresh	
  Token	
  	
  
var	
  reques;fy	
  =	
  require('reques;fy');	
  
	
  	
  	
  	
  reques;fy.post('hbp://example.com',	
  {	
  grant_type:’refresh_token’,	
  
client_id:’myid’,	
  
client_secret:‘1955279925675241571’,	
  
refresh_token:	
  ‘3MVG9lKcPoNINVBIPJjdw1J9LLM82HnFVVX19KY1uA5mu0	
  
QqEWhqKpoW3svG3XHrXDiCQjK1mdgAvhCscA9GE’	
  
})	
  
	
  	
  	
  	
  .then(func;on(response)	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  //	
  Get	
  the	
  response	
  body	
  (JSON	
  parsed	
  or	
  jQuery	
  object	
  for	
  XMLs)	
  
	
  	
  	
  	
  	
  	
  	
  	
  response.getBody();	
  
	
  	
  	
  	
  });	
  
Client	
  Creden;als	
  	
  
var	
  reques;fy	
  =	
  require('reques;fy');	
  
	
  	
  	
  	
  reques;fy.post('hbp://example.com',	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  redirect_uri:	
  'hbps%3A%2F%2Fexample.org%2callback',	
  
	
  grant_type:’client_creden;als’,	
   	
  	
  
	
  client_secret:’2Federate’,	
  
	
  client_id:'myId’,	
  
	
  scope:’read’,	
  
})	
  
	
  	
  	
  	
  .then(func;on(response)	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  //	
  Get	
  the	
  response	
  body	
  (JSON	
  parsed	
  or	
  jQuery	
  object	
  for	
  XMLs)	
  
	
  	
  	
  	
  	
  	
  	
  	
  response.getBody();	
  
	
  	
  	
  	
  });	
  
Extension	
  
…	
  
Choosing	
  a	
  Grant	
  Type	
  for	
  OpenID	
  
Connect	
  
•  Authoriza;on	
  Code	
  Flow	
  
•  Implicit	
  Flow	
  	
  
•  Hybrid	
  Flow	
  
Authoriza;on	
  Code	
  Flow	
  
1.  Client	
  prepares	
  an	
  Authen;ca;on	
  Request	
  containing	
  the	
  desired	
  request	
  
parameters.	
  
2.  Client	
  sends	
  the	
  request	
  to	
  the	
  Authoriza;on	
  Server.	
  
3.  Authoriza;on	
  Server	
  Authen;cates	
  the	
  End-­‐User.	
  
4.  Authoriza;on	
  Server	
  obtains	
  End-­‐User	
  Consent/Authoriza;on.	
  
5.  Authoriza;on	
  Server	
  sends	
  the	
  End-­‐User	
  back	
  to	
  the	
  Client	
  with	
  an	
  Authoriza;on	
  
Code.	
  
6.  Client	
  requests	
  a	
  response	
  using	
  the	
  Authoriza;on	
  Code	
  at	
  the	
  Token	
  Endpoint.	
  
7.  Client	
  receives	
  a	
  response	
  that	
  contains	
  an	
  ID	
  Token	
  and	
  Access	
  Token	
  in	
  the	
  
response	
  body.	
  
8.  Client	
  validates	
  the	
  ID	
  token	
  and	
  retrieves	
  the	
  End-­‐User's	
  Subject	
  Iden;fier.	
  
Authoriza;on	
  Code	
  Flow	
  
var	
  reques;fy	
  =	
  require('reques;fy');	
  
	
  	
  	
  	
  reques;fy.post('hbp://example.com',	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  redirect_uri:	
  'hbps%3A%2F%2Fexample.org%2callback',	
  
	
  response_type:'code',	
  
	
  client_id:'myId’,	
  
	
  scope:’read’,	
  
	
  state:’343msdjasd9k2’	
  
	
  	
  	
  	
  })	
  
	
  	
  	
  	
  .then(func;on(response)	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  //	
  Get	
  the	
  response	
  body	
  (JSON	
  parsed	
  or	
  jQuery	
  object	
  for	
  XMLs)	
  
	
  	
  	
  	
  	
  	
  	
  	
  response.getBody();	
  
	
  	
  	
  	
  });	
  
Authoriza;on	
  Code	
  Token	
  Response	
  
{	
  
	
  	
  	
  "access_token":	
  "SlAV32hkKG",	
  
	
  	
  	
  "token_type":	
  "Bearer",	
  
	
  	
  	
  "refresh_token":	
  "8xLOxBtZp8",	
  
	
  	
  	
  "expires_in":	
  3600,	
  
	
  	
  	
  "id_token":	
  "eyJhbGciOiJSUzI1NiIsImtpZCI6IjFlOWdkazcifQ.ewogImlzc	
  
	
  	
  	
  	
  	
  yI6ICJodHRwOi8vc2VydmVyLmV4YW1wbGUuY29tIiwKICJzdWIiOiAiMjQ4Mjg5	
  
	
  	
  	
  	
  	
  NzYxMDAxIiwKICJhdWQiOiAiczZCaGRSa3F0MyIsCiAibm9uY2UiOiAibi0wUzZ	
  
	
  	
  	
  	
  	
  fV3pBMk1qIiwKICJleHAiOiAxMzExMjgxOTcwLAogImlhdCI6IDEzMTEyODA5Nz	
  
	
  	
  	
  	
  	
  AKfQ.ggW8hZ1EuVLuxNuuIJKX_V8a_OMXzR0EHR9R6jgdqrOOF4daGU96Sr_P6q	
  
	
  	
  	
  	
  	
  Jp6IcmD3HP99Obi1PRs-­‐cwh3LO-­‐p146waJ8IhehcwL7F09JdijmBqkvPeB2T9CJ	
  
	
  	
  	
  	
  	
  NqeGpe-­‐gccMg4vfKjkM8FcGvnzZUN4_KSP0aAp1tOJ1zZwgjxqGByKHiOtX7Tpd	
  
	
  	
  	
  	
  	
  QyHE5lcMiKPXfEIQILVq0pc_E2DzL7emopWoaoZTF_m0_N0YzFC6g6EJbOEoRoS	
  
	
  	
  	
  	
  	
  K5hoDalrcvRYLSrQAZZKflyuVCyixEoV9GfNQC3_osjzw2PAithfubEEBLuVVk4	
  
	
  	
  	
  	
  	
  XUVrWOLrLl0nx7RkKU8NXNHq-­‐rvKMzqg"	
  
	
  	
  }	
  
The	
  ID	
  token	
  If	
  the	
  ID	
  Token	
  is	
  encrypted,	
  decrypt	
  it	
  using	
  the	
  keys	
  and	
  algorithms	
  that	
  the	
  Client	
  specified	
  during	
  Registra;on	
  that	
  the	
  OP	
  was	
  to	
  use	
  to	
  encrypt	
  the	
  ID	
  Token.	
  If	
  encryp;on	
  
was	
  nego;ated	
  with	
  the	
  OP	
  at	
  Registra;on	
  ;me	
  and	
  the	
  ID	
  Token	
  is	
  not	
  encrypted,	
  the	
  RP	
  SHOULD	
  reject	
  it.	
  
The	
  Issuer	
  Iden;fier	
  for	
  the	
  OpenID	
  Provider	
  (which	
  is	
  typically	
  obtained	
  during	
  Discovery)	
  MUST	
  exactly	
  match	
  the	
  value	
  of	
  the	
  iss	
  (issuer)	
  Claim.	
  
The	
  Client	
  MUST	
  validate	
  that	
  the	
  aud	
  (audience)	
  Claim	
  contains	
  its	
  client_id	
  value	
  registered	
  at	
  the	
  Issuer	
  iden;fied	
  by	
  the	
  iss	
  (issuer)	
  Claim	
  as	
  an	
  audience.	
  The	
  aud	
  
(audience)	
  Claim	
  MAY	
  contain	
  an	
  array	
  with	
  more	
  than	
  one	
  element.	
  The	
  ID	
  Token	
  MUST	
  be	
  rejected	
  if	
  the	
  ID	
  Token	
  does	
  not	
  list	
  the	
  Client	
  as	
  a	
  valid	
  audience,	
  or	
  if	
  it	
  
contains	
  addi;onal	
  audiences	
  not	
  trusted	
  by	
  the	
  Client.	
  
If	
  the	
  ID	
  Token	
  contains	
  mul;ple	
  audiences,	
  the	
  Client	
  SHOULD	
  verify	
  that	
  an	
  azp	
  Claim	
  is	
  present.	
  
If	
  an	
  azp	
  (authorized	
  party)	
  Claim	
  is	
  present,	
  the	
  Client	
  SHOULD	
  verify	
  that	
  its	
  client_id	
  is	
  the	
  Claim	
  Value.	
  
If	
  the	
  ID	
  Token	
  is	
  received	
  via	
  direct	
  communica;on	
  between	
  the	
  Client	
  and	
  the	
  Token	
  Endpoint	
  (which	
  it	
  is	
  in	
  this	
  flow),	
  the	
  TLS	
  server	
  valida;on	
  MAY	
  be	
  used	
  to	
  validate	
  
the	
  issuer	
  in	
  place	
  of	
  checking	
  the	
  token	
  signature.	
  The	
  Client	
  MUST	
  validate	
  the	
  signature	
  of	
  all	
  other	
  ID	
  Tokens	
  according	
  to	
  JWS	
  [JWS]	
  using	
  the	
  algorithm	
  specified	
  in	
  the	
  
JWT	
  alg	
  header	
  parameter.	
  The	
  Client	
  MUST	
  use	
  the	
  keys	
  provided	
  by	
  the	
  Issuer.	
  
The	
  alg	
  value	
  SHOULD	
  be	
  the	
  default	
  of	
  RS256	
  or	
  the	
  algorithm	
  sent	
  by	
  the	
  Client	
  in	
  the	
  id_token_signed_response_alg	
  parameter	
  during	
  Registra;on.	
  
If	
  the	
  JWT	
  alg	
  header	
  parameter	
  uses	
  a	
  MAC	
  based	
  algorithm	
  such	
  as	
  HS256,	
  HS384,	
  or	
  HS512,	
  the	
  octets	
  of	
  the	
  UTF-­‐8	
  representa;on	
  of	
  the	
  client_secret	
  corresponding	
  to	
  
the	
  client_id	
  contained	
  in	
  the	
  aud	
  (audience)	
  Claim	
  are	
  used	
  as	
  the	
  key	
  to	
  validate	
  the	
  signature.	
  For	
  MAC	
  based	
  algorithms,	
  the	
  behavior	
  is	
  unspecified	
  if	
  the	
  aud	
  is	
  mul;-­‐
valued	
  or	
  if	
  an	
  azp	
  value	
  is	
  present	
  that	
  is	
  different	
  than	
  the	
  aud	
  value.	
  
The	
  current	
  ;me	
  MUST	
  be	
  before	
  the	
  ;me	
  represented	
  by	
  the	
  exp	
  Claim.	
  
The	
  iat	
  Claim	
  can	
  be	
  used	
  to	
  reject	
  tokens	
  that	
  were	
  issued	
  too	
  far	
  away	
  from	
  the	
  current	
  ;me,	
  limi;ng	
  the	
  amount	
  of	
  ;me	
  that	
  nonces	
  need	
  to	
  be	
  stored	
  to	
  prevent	
  abacks.	
  
The	
  acceptable	
  range	
  is	
  Client	
  specific.	
  
If	
  a	
  nonce	
  value	
  was	
  sent	
  in	
  the	
  Authen;ca;on	
  Request,	
  a	
  nonce	
  Claim	
  MUST	
  be	
  present	
  and	
  its	
  value	
  checked	
  to	
  verify	
  that	
  it	
  is	
  the	
  same	
  value	
  as	
  the	
  one	
  that	
  was	
  sent	
  in	
  
the	
  Authen;ca;on	
  Request.	
  The	
  Client	
  SHOULD	
  check	
  the	
  nonce	
  value	
  for	
  replay	
  abacks.	
  The	
  precise	
  method	
  for	
  detec;ng	
  replay	
  abacks	
  is	
  Client	
  specific.	
  
If	
  the	
  acr	
  Claim	
  was	
  requested,	
  the	
  Client	
  SHOULD	
  check	
  that	
  the	
  asserted	
  Claim	
  Value	
  is	
  appropriate.	
  The	
  meaning	
  and	
  processing	
  of	
  acr	
  Claim	
  Values	
  is	
  out	
  of	
  scope	
  for	
  this	
  
specifica;on.	
  
If	
  the	
  auth_;me	
  Claim	
  was	
  requested,	
  either	
  through	
  a	
  specific	
  request	
  for	
  this	
  Claim	
  or	
  by	
  using	
  the	
  max_age	
  parameter,	
  the	
  Client	
  SHOULD	
  check	
  the	
  auth_;me	
  Claim	
  
value	
  and	
  request	
  re-­‐authen;ca;on	
  if	
  it	
  determines	
  too	
  much	
  ;me	
  has	
  elapsed	
  since	
  the	
  last	
  End-­‐User	
  authen;ca;on.	
  
Before	
  you	
  start	
  coding…	
  
hbp://openid.net/developers/libraries/	
  
	
  
Libraries	
  list	
  for:	
  	
  
C,	
  C#,	
  Java,	
  PHP,	
  Python,	
  Ruby,	
  Javascript	
  
	
  
And	
  Products…	
  
ID	
  token	
  
{	
  
	
  	
  	
  "iss":	
  "hbps://server.example.com",	
  
	
  	
  	
  "sub":	
  "24400320",	
  
	
  	
  	
  "aud":	
  "s6BhdRkqt3",	
  
	
  	
  	
  "nonce":	
  "n-­‐0S6_WzA2Mj",	
  
	
  	
  	
  "exp":	
  1311281970,	
  
	
  	
  	
  "iat":	
  1311280970,	
  
	
  	
  	
  "auth_;me":	
  1311280969,	
  
	
  	
  	
  "acr":	
  "urn:mace:incommon:iap:silver"	
  
	
  	
  }	
  
Implicit	
  Flow	
  	
  
Client	
  prepares	
  an	
  Authen;ca;on	
  Request	
  containing	
  the	
  
desired	
  request	
  parameters.	
  
Client	
  sends	
  the	
  request	
  to	
  the	
  Authoriza;on	
  Server.	
  
Authoriza;on	
  Server	
  Authen;cates	
  the	
  End-­‐User.	
  
Authoriza;on	
  Server	
  obtains	
  End-­‐User	
  Consent/Authoriza;on.	
  
Authoriza;on	
  Server	
  sends	
  the	
  End-­‐User	
  back	
  to	
  the	
  Client	
  
with	
  an	
  ID	
  Token	
  and,	
  if	
  requested,	
  an	
  Access	
  Token.	
  
Client	
  validates	
  the	
  ID	
  token	
  and	
  retrieves	
  the	
  End-­‐User's	
  
Subject	
  Iden;fier.	
  
Calling	
  the	
  User	
  Info	
  Endpoint	
  
GET	
  /userinfo	
  HTTP/1.1	
  
	
  	
  Host:	
  server.example.com	
  
	
  	
  Authoriza;on:	
  Bearer	
  SlAV32hkK	
  
Claims	
  
{	
  
	
  	
  	
  "sub":	
  "248289761001",	
  
	
  	
  	
  "name":	
  "Jane	
  Doe",	
  
	
  	
  	
  "given_name":	
  "Jane",	
  
	
  	
  	
  "family_name":	
  "Doe",	
  
	
  	
  	
  "preferred_username":	
  "j.doe",	
  
	
  	
  	
  "email":	
  "janedoe@example.com",	
  
	
  	
  	
  "picture":	
  "hbp://example.com/janedoe/me.jpg"	
  
	
  	
  }	
  
More…	
  Member 	
  Type 	
  Descrip;on	
  
sub 	
  string 	
  Subject	
  -­‐	
  Iden;fier	
  for	
  the	
  End-­‐User	
  at	
  the	
  Issuer.	
  
name 	
  string 	
  End-­‐User's	
  full	
  name	
  in	
  displayable	
  form	
  including	
  all	
  name	
  parts,	
  possibly	
  including	
  ;tles	
  and	
  suffixes,	
  ordered	
  according	
  to	
  the	
  End-­‐User's	
  locale	
  and	
  preferences.	
  
given_name 	
  string 	
  Given	
  name(s)	
  or	
  first	
  name(s)	
  of	
  the	
  End-­‐User.	
  Note	
  that	
  in	
  some	
  cultures,	
  people	
  can	
  have	
  mul;ple	
  given	
  names;	
  all	
  can	
  be	
  present,	
  with	
  the	
  names	
  being	
  separated	
  by	
  space	
  
characters.	
  
family_name 	
  string 	
  Surname(s)	
  or	
  last	
  name(s)	
  of	
  the	
  End-­‐User.	
  Note	
  that	
  in	
  some	
  cultures,	
  people	
  can	
  have	
  mul;ple	
  family	
  names	
  or	
  no	
  family	
  name;	
  all	
  can	
  be	
  present,	
  with	
  the	
  names	
  being	
  
separated	
  by	
  space	
  characters.	
  
middle_name 	
  string 	
  Middle	
  name(s)	
  of	
  the	
  End-­‐User.	
  Note	
  that	
  in	
  some	
  cultures,	
  people	
  can	
  have	
  mul;ple	
  middle	
  names;	
  all	
  can	
  be	
  present,	
  with	
  the	
  names	
  being	
  separated	
  by	
  space	
  characters.	
  
Also	
  note	
  that	
  in	
  some	
  cultures,	
  middle	
  names	
  are	
  not	
  used.	
  
nickname 	
  string 	
  Casual	
  name	
  of	
  the	
  End-­‐User	
  that	
  may	
  or	
  may	
  not	
  be	
  the	
  same	
  as	
  the	
  given_name.	
  For	
  instance,	
  a	
  nickname	
  value	
  of	
  Mike	
  might	
  be	
  returned	
  alongside	
  a	
  given_name	
  value	
  of	
  Michael.	
  
preferred_username 	
  string 	
  Shorthand	
  name	
  by	
  which	
  the	
  End-­‐User	
  wishes	
  to	
  be	
  referred	
  to	
  at	
  the	
  RP,	
  such	
  as	
  janedoe	
  or	
  j.doe.	
  This	
  value	
  MAY	
  be	
  any	
  valid	
  JSON	
  string	
  including	
  special	
  characters	
  such	
  
as	
  @,	
  /,	
  or	
  whitespace.	
  The	
  RP	
  MUST	
  NOT	
  rely	
  upon	
  this	
  value	
  being	
  unique,	
  as	
  discussed	
  in	
  Sec;on	
  5.7.	
  
profile 	
  string 	
  URL	
  of	
  the	
  End-­‐User's	
  profile	
  page.	
  The	
  contents	
  of	
  this	
  Web	
  page	
  SHOULD	
  be	
  about	
  the	
  End-­‐User.	
  
picture 	
  string 	
  URL	
  of	
  the	
  End-­‐User's	
  profile	
  picture.	
  This	
  URL	
  MUST	
  refer	
  to	
  an	
  image	
  file	
  (for	
  example,	
  a	
  PNG,	
  JPEG,	
  or	
  GIF	
  image	
  file),	
  rather	
  than	
  to	
  a	
  Web	
  page	
  containing	
  an	
  image.	
  Note	
  that	
  this	
  
URL	
  SHOULD	
  specifically	
  reference	
  a	
  profile	
  photo	
  of	
  the	
  End-­‐User	
  suitable	
  for	
  displaying	
  when	
  describing	
  the	
  End-­‐User,	
  rather	
  than	
  an	
  arbitrary	
  photo	
  taken	
  by	
  the	
  End-­‐User.	
  
website 	
  string 	
  URL	
  of	
  the	
  End-­‐User's	
  Web	
  page	
  or	
  blog.	
  This	
  Web	
  page	
  SHOULD	
  contain	
  informa;on	
  published	
  by	
  the	
  End-­‐User	
  or	
  an	
  organiza;on	
  that	
  the	
  End-­‐User	
  is	
  affiliated	
  with.	
  
email 	
  string 	
  End-­‐User's	
  preferred	
  e-­‐mail	
  address.	
  Its	
  value	
  MUST	
  conform	
  to	
  the	
  RFC	
  5322	
  [RFC5322]	
  addr-­‐spec	
  syntax.	
  The	
  RP	
  MUST	
  NOT	
  rely	
  upon	
  this	
  value	
  being	
  unique,	
  as	
  discussed	
  in	
  Sec;on	
  
5.7.	
  
email_verified 	
  boolean 	
  True	
  if	
  the	
  End-­‐User's	
  e-­‐mail	
  address	
  has	
  been	
  verified;	
  otherwise	
  false.	
  When	
  this	
  Claim	
  Value	
  is	
  true,	
  this	
  means	
  that	
  the	
  OP	
  took	
  affirma;ve	
  steps	
  to	
  ensure	
  that	
  this	
  e-­‐mail	
  
address	
  was	
  controlled	
  by	
  the	
  End-­‐User	
  at	
  the	
  ;me	
  the	
  verifica;on	
  was	
  performed.	
  The	
  means	
  by	
  which	
  an	
  e-­‐mail	
  address	
  is	
  verified	
  is	
  context-­‐specific,	
  and	
  dependent	
  upon	
  the	
  trust	
  framework	
  or	
  contractual	
  
agreements	
  within	
  which	
  the	
  par;es	
  are	
  opera;ng.	
  
gender 	
  string 	
  End-­‐User's	
  gender.	
  Values	
  defined	
  by	
  this	
  specifica;on	
  are	
  female	
  and	
  male.	
  Other	
  values	
  MAY	
  be	
  used	
  when	
  neither	
  of	
  the	
  defined	
  values	
  are	
  applicable.	
  
birthdate 	
  string 	
  End-­‐User's	
  birthday,	
  represented	
  as	
  an	
  ISO	
  8601:2004	
  [ISO8601‑2004]	
  YYYY-­‐MM-­‐DD	
  format.	
  The	
  year	
  MAY	
  be	
  0000,	
  indica;ng	
  that	
  it	
  is	
  omibed.	
  To	
  represent	
  only	
  the	
  year,	
  YYYY	
  format	
  
is	
  allowed.	
  Note	
  that	
  depending	
  on	
  the	
  underlying	
  pla€orm's	
  date	
  related	
  func;on,	
  providing	
  just	
  year	
  can	
  result	
  in	
  varying	
  month	
  and	
  day,	
  so	
  the	
  implementers	
  need	
  to	
  take	
  this	
  factor	
  into	
  account	
  to	
  
correctly	
  process	
  the	
  dates.	
  
zoneinfo 	
  string 	
  String	
  from	
  zoneinfo	
  [zoneinfo]	
  ;me	
  zone	
  database	
  represen;ng	
  the	
  End-­‐User's	
  ;me	
  zone.	
  For	
  example,	
  Europe/Paris	
  or	
  America/Los_Angeles.	
  
locale 	
  string 	
  End-­‐User's	
  locale,	
  represented	
  as	
  a	
  BCP47	
  [RFC5646]	
  language	
  tag.	
  This	
  is	
  typically	
  an	
  ISO	
  639-­‐1	
  Alpha-­‐2	
  [ISO639‑1]	
  language	
  code	
  in	
  lowercase	
  and	
  an	
  ISO	
  3166-­‐1	
  Alpha-­‐2	
  [ISO3166‑1]	
  
country	
  code	
  in	
  uppercase,	
  separated	
  by	
  a	
  dash.	
  For	
  example,	
  en-­‐US	
  or	
  fr-­‐CA.	
  As	
  a	
  compa;bility	
  note,	
  some	
  implementa;ons	
  have	
  used	
  an	
  underscore	
  as	
  the	
  separator	
  rather	
  than	
  a	
  dash,	
  for	
  example,	
  en_US;	
  
Relying	
  Par;es	
  MAY	
  choose	
  to	
  accept	
  this	
  locale	
  syntax	
  as	
  well.	
  
phone_number 	
  string 	
  End-­‐User's	
  preferred	
  telephone	
  number.	
  E.164	
  [E.164]	
  is	
  RECOMMENDED	
  as	
  the	
  format	
  of	
  this	
  Claim,	
  for	
  example,	
  +1	
  (425)	
  555-­‐1212	
  or	
  +56	
  (2)	
  687	
  2400.	
  If	
  the	
  phone	
  number	
  
contains	
  an	
  extension,	
  it	
  is	
  RECOMMENDED	
  that	
  the	
  extension	
  be	
  represented	
  using	
  the	
  RFC	
  3966	
  [RFC3966]	
  extension	
  syntax,	
  for	
  example,	
  +1	
  (604)	
  555-­‐1234;ext=5678.	
  
phone_number_verified 	
  boolean 	
  True	
  if	
  the	
  End-­‐User's	
  phone	
  number	
  has	
  been	
  verified;	
  otherwise	
  false.	
  When	
  this	
  Claim	
  Value	
  is	
  true,	
  this	
  means	
  that	
  the	
  OP	
  took	
  affirma;ve	
  steps	
  to	
  ensure	
  that	
  
this	
  phone	
  number	
  was	
  controlled	
  by	
  the	
  End-­‐User	
  at	
  the	
  ;me	
  the	
  verifica;on	
  was	
  performed.	
  The	
  means	
  by	
  which	
  a	
  phone	
  number	
  is	
  verified	
  is	
  context-­‐specific,	
  and	
  dependent	
  upon	
  the	
  trust	
  framework	
  or	
  
contractual	
  agreements	
  within	
  which	
  the	
  par;es	
  are	
  opera;ng.	
  When	
  true,	
  the	
  phone_number	
  Claim	
  MUST	
  be	
  in	
  E.164	
  format	
  and	
  any	
  extensions	
  MUST	
  be	
  represented	
  in	
  RFC	
  3966	
  format.	
  
address 	
  JSON	
  object 	
  End-­‐User's	
  preferred	
  postal	
  address.	
  The	
  value	
  of	
  the	
  address	
  member	
  is	
  a	
  JSON	
  [RFC4627]	
  structure	
  containing	
  some	
  or	
  all	
  of	
  the	
  members	
  defined	
  in	
  Sec;on	
  5.1.1.	
  
updated_at 	
  number 	
  Time	
  the	
  End-­‐User's	
  informa;on	
  was	
  last	
  updated.	
  Its	
  value	
  is	
  a	
  JSON	
  number	
  represen;ng	
  the	
  number	
  of	
  seconds	
  from	
  1970-­‐01-­‐01T0:0:0Z	
  as	
  measured	
  in	
  UTC	
  un;l	
  the	
  date/
;me.	
  
Handling	
  Refresh	
  Tokens	
  and	
  
Managing	
  Sessions	
  
•  Web	
  Server/Applica;on	
  
– Refresh	
  Token	
  
•  Mobile/Javascript	
  Browser	
  Client	
  
– No	
  Refresh	
  Token	
  
Concerns	
  
•  Losing	
  Tokens	
  (Open	
  Redirects)	
  
•  Losing	
  client	
  creden;als	
  
•  OAuth	
  isn’t	
  SSO!	
  
Ques;ons	
  /	
  References	
  
Confidential — do not distribute Copyright © 2013 Ping Identity Corp.All rights reserved. 27
OpenID Connect
http://openid.net/connect
OAuth 2.0
http://oauth.net/2
JSON Web Token (JWT)
http://tools.ietf.org/html/draft-ietf-oauth-json-web-token

More Related Content

What's hot (20)

PDF
Pushed Authorization Requests
Torsten Lodderstedt
 
PDF
What the Heck is OAuth and Open ID Connect? - UberConf 2017
Matt Raible
 
PDF
What the Heck is OAuth and OIDC - UberConf 2018
Matt Raible
 
PDF
Java Web Programming [9/9] : Web Application Security
IMC Institute
 
PDF
DEF CON 27 - ALVARO MUNOZ / OLEKSANDR MIROSH - sso wars the token menace
Felipe Prado
 
PDF
Demystifying OAuth 2.0
Karl McGuinness
 
PDF
Summary of OAuth 2.0 draft 8 memo
Ryo Ito
 
PDF
RoadSec 2017 - Trilha AppSec - APIs Authorization
Erick Belluci Tedeschi
 
PPT
Top Ten Web Defenses - DefCamp 2012
DefCamp
 
PDF
OAuth 2.0 – A standard is coming of age by Uwe Friedrichsen
Codemotion
 
PPTX
Cargo Cult Security UJUG Sep2015
Derrick Isaacson
 
PDF
OAuth 2.0
Uwe Friedrichsen
 
PPTX
Oauth 2.0 security
vinoth kumar
 
PDF
Introduction to OAuth
Paul Osman
 
PPTX
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
Fermin Galan
 
PDF
OAuth Base Camp
Oliver Pfaff
 
PDF
FIWARE Global Summit - Hands-On NGSI-LD
FIWARE
 
PPTX
JWTs and JOSE in a flash
Evan J Johnson (Not a CISSP)
 
PPTX
Orion Context Broker NGSI-v2 Overview for Developers That Already Know Ngsi-v...
Fermin Galan
 
PDF
Saml authentication bypass
Tarachand Verma
 
Pushed Authorization Requests
Torsten Lodderstedt
 
What the Heck is OAuth and Open ID Connect? - UberConf 2017
Matt Raible
 
What the Heck is OAuth and OIDC - UberConf 2018
Matt Raible
 
Java Web Programming [9/9] : Web Application Security
IMC Institute
 
DEF CON 27 - ALVARO MUNOZ / OLEKSANDR MIROSH - sso wars the token menace
Felipe Prado
 
Demystifying OAuth 2.0
Karl McGuinness
 
Summary of OAuth 2.0 draft 8 memo
Ryo Ito
 
RoadSec 2017 - Trilha AppSec - APIs Authorization
Erick Belluci Tedeschi
 
Top Ten Web Defenses - DefCamp 2012
DefCamp
 
OAuth 2.0 – A standard is coming of age by Uwe Friedrichsen
Codemotion
 
Cargo Cult Security UJUG Sep2015
Derrick Isaacson
 
OAuth 2.0
Uwe Friedrichsen
 
Oauth 2.0 security
vinoth kumar
 
Introduction to OAuth
Paul Osman
 
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
Fermin Galan
 
OAuth Base Camp
Oliver Pfaff
 
FIWARE Global Summit - Hands-On NGSI-LD
FIWARE
 
JWTs and JOSE in a flash
Evan J Johnson (Not a CISSP)
 
Orion Context Broker NGSI-v2 Overview for Developers That Already Know Ngsi-v...
Fermin Galan
 
Saml authentication bypass
Tarachand Verma
 

Viewers also liked (12)

PDF
CIS14: Are the Enterprises Ready for Identity of Everything?
CloudIDSummit
 
PDF
OAuth 2.0 Token Exchange: An STS for the REST of Us
Brian Campbell
 
PPTX
Reinforcing Your Enterprise With Security Architectures
Uthaiyashankar
 
PPTX
Enabling Cloud Native Security with OAuth2 and Multi-Tenant UAA
Will Tran
 
PDF
Introduction to OpenID Connect
Nat Sakimura
 
PPTX
Building IAM for OpenStack
Steve Martinelli
 
PPTX
Identity and Access Management in the Era of Digital Transformation
Uthaiyashankar
 
PPTX
Ldap intro
yousry ibrahim
 
PDF
Authorization and Authentication in Microservice Environments
LeanIX GmbH
 
PDF
Introduction to LDAP and Directory Services
Radovan Semancik
 
PDF
SAML / OpenID Connect / OAuth / SCIM 技術解説 - ID&IT 2014 #idit2014
Nov Matake
 
PPTX
Identity and Access Management - RSA 2017 Security Foundations Seminar
Brian Campbell
 
CIS14: Are the Enterprises Ready for Identity of Everything?
CloudIDSummit
 
OAuth 2.0 Token Exchange: An STS for the REST of Us
Brian Campbell
 
Reinforcing Your Enterprise With Security Architectures
Uthaiyashankar
 
Enabling Cloud Native Security with OAuth2 and Multi-Tenant UAA
Will Tran
 
Introduction to OpenID Connect
Nat Sakimura
 
Building IAM for OpenStack
Steve Martinelli
 
Identity and Access Management in the Era of Digital Transformation
Uthaiyashankar
 
Ldap intro
yousry ibrahim
 
Authorization and Authentication in Microservice Environments
LeanIX GmbH
 
Introduction to LDAP and Directory Services
Radovan Semancik
 
SAML / OpenID Connect / OAuth / SCIM 技術解説 - ID&IT 2014 #idit2014
Nov Matake
 
Identity and Access Management - RSA 2017 Security Foundations Seminar
Brian Campbell
 
Ad

Similar to CIS14: Developing with OAuth and OIDC Connect (20)

PDF
Full stack security
DPC Consulting Ltd
 
PDF
AllTheTalks.Online 2020: "Basics of OAuth 2.0 and OpenID Connect"
Andreas Falk
 
PDF
CIS14: Working with OAuth and OpenID Connect
CloudIDSummit
 
PDF
Introducing OpenID 1.0 Protocol: Security and Performance
Amin Saqi
 
PDF
RFC6749 et alia 20130504
Mattias Jidhage
 
PDF
2019 - Tech Talk DC - Token-based security for web applications using OAuth2 ...
Vladimir Bychkov
 
PDF
OpenID Connect Explained
Vladimir Dzhuvinov
 
PPTX
Intro to OAuth2 and OpenID Connect
LiamWadman
 
PPTX
OAuth2 and OpenID with Spring Boot
Geert Pante
 
PPTX
Wso2 is integration with .net core
Ismaeel Enjreny
 
PDF
OAuth 2.0 and OpenID Connect
Jacob Combs
 
PPTX
(4) OAuth 2.0 Obtaining Authorization
anikristo
 
PDF
Distributed Identities with OpenID
Bastian Hofmann
 
PDF
Distributed Identities with OpenID
Bastian Hofmann
 
PPTX
OAuth 2
ChrisWood262
 
PPTX
Microservice security with spring security 5.1,Oauth 2.0 and open id connect
Nilanjan Roy
 
PPTX
The Client is not always right! How to secure OAuth authentication from your...
Mike Schwartz
 
PDF
InterCon 2016 - Segurança de identidade digital levando em consideração uma a...
iMasters
 
PDF
iMasters Intercon 2016 - Identity within Microservices
Erick Belluci Tedeschi
 
PDF
I Don't Care About Security (And Neither Should You)
Joel Lord
 
Full stack security
DPC Consulting Ltd
 
AllTheTalks.Online 2020: "Basics of OAuth 2.0 and OpenID Connect"
Andreas Falk
 
CIS14: Working with OAuth and OpenID Connect
CloudIDSummit
 
Introducing OpenID 1.0 Protocol: Security and Performance
Amin Saqi
 
RFC6749 et alia 20130504
Mattias Jidhage
 
2019 - Tech Talk DC - Token-based security for web applications using OAuth2 ...
Vladimir Bychkov
 
OpenID Connect Explained
Vladimir Dzhuvinov
 
Intro to OAuth2 and OpenID Connect
LiamWadman
 
OAuth2 and OpenID with Spring Boot
Geert Pante
 
Wso2 is integration with .net core
Ismaeel Enjreny
 
OAuth 2.0 and OpenID Connect
Jacob Combs
 
(4) OAuth 2.0 Obtaining Authorization
anikristo
 
Distributed Identities with OpenID
Bastian Hofmann
 
Distributed Identities with OpenID
Bastian Hofmann
 
OAuth 2
ChrisWood262
 
Microservice security with spring security 5.1,Oauth 2.0 and open id connect
Nilanjan Roy
 
The Client is not always right! How to secure OAuth authentication from your...
Mike Schwartz
 
InterCon 2016 - Segurança de identidade digital levando em consideração uma a...
iMasters
 
iMasters Intercon 2016 - Identity within Microservices
Erick Belluci Tedeschi
 
I Don't Care About Security (And Neither Should You)
Joel Lord
 
Ad

More from CloudIDSummit (20)

PPTX
CIS 2016 Content Highlights
CloudIDSummit
 
PPTX
Top 6 Reasons You Should Attend Cloud Identity Summit 2016
CloudIDSummit
 
PDF
CIS 2015 Security Without Borders: Taming the Cloud and Mobile Frontier - And...
CloudIDSummit
 
PDF
Mobile security, identity & authentication reasons for optimism 20150607 v2
CloudIDSummit
 
PDF
CIS 2015 Mobile Security, Identity & Authentication: Reasons for Optimism - R...
CloudIDSummit
 
PDF
CIS 2015 Virtual Identity: The Vision, Challenges and Experiences in Driving ...
CloudIDSummit
 
PDF
CIS 2015 Deploying Strong Authentication to a Global Enterprise: A Comedy in ...
CloudIDSummit
 
PDF
CIS 2015 Without Great Security, Digital Identity is Not Worth the Electrons ...
CloudIDSummit
 
PDF
CIS 2015 Mergers & Acquisitions in a Cloud Enabled World - Brian Puhl
CloudIDSummit
 
PDF
CIS 2015 IoT and IDM in your Mobile Enterprise - Brian Katz
CloudIDSummit
 
PDF
CIS 2015 Practical Deployments Enterprise Cloud Access Management Platform - ...
CloudIDSummit
 
PDF
CIS 2015 What I Learned From Pitching IAM To My CIO - Steve Tout
CloudIDSummit
 
PDF
CIS 2015 How to secure the Internet of Things? Hannes Tschofenig
CloudIDSummit
 
PDF
CIS 2015 The IDaaS Dating Game - Sean Deuby
CloudIDSummit
 
PDF
CIS 2015 SSO for Mobile and Web Apps Ashish Jain
CloudIDSummit
 
PDF
The Industrial Internet, the Identity of Everything and the Industrial Enterp...
CloudIDSummit
 
PDF
CIS 2015 SAML-IN / SAML-OUT - Scott Tomilson & John Dasilva
CloudIDSummit
 
PDF
CIS 2015 Session Management at Scale - Scott Tomilson & Jamshid Khosravian
CloudIDSummit
 
PDF
CIS 2015 So you want to SSO … Scott Tomilson & John Dasilva
CloudIDSummit
 
PDF
CIS 2015 Identity Relationship Management in the Internet of Things
CloudIDSummit
 
CIS 2016 Content Highlights
CloudIDSummit
 
Top 6 Reasons You Should Attend Cloud Identity Summit 2016
CloudIDSummit
 
CIS 2015 Security Without Borders: Taming the Cloud and Mobile Frontier - And...
CloudIDSummit
 
Mobile security, identity & authentication reasons for optimism 20150607 v2
CloudIDSummit
 
CIS 2015 Mobile Security, Identity & Authentication: Reasons for Optimism - R...
CloudIDSummit
 
CIS 2015 Virtual Identity: The Vision, Challenges and Experiences in Driving ...
CloudIDSummit
 
CIS 2015 Deploying Strong Authentication to a Global Enterprise: A Comedy in ...
CloudIDSummit
 
CIS 2015 Without Great Security, Digital Identity is Not Worth the Electrons ...
CloudIDSummit
 
CIS 2015 Mergers & Acquisitions in a Cloud Enabled World - Brian Puhl
CloudIDSummit
 
CIS 2015 IoT and IDM in your Mobile Enterprise - Brian Katz
CloudIDSummit
 
CIS 2015 Practical Deployments Enterprise Cloud Access Management Platform - ...
CloudIDSummit
 
CIS 2015 What I Learned From Pitching IAM To My CIO - Steve Tout
CloudIDSummit
 
CIS 2015 How to secure the Internet of Things? Hannes Tschofenig
CloudIDSummit
 
CIS 2015 The IDaaS Dating Game - Sean Deuby
CloudIDSummit
 
CIS 2015 SSO for Mobile and Web Apps Ashish Jain
CloudIDSummit
 
The Industrial Internet, the Identity of Everything and the Industrial Enterp...
CloudIDSummit
 
CIS 2015 SAML-IN / SAML-OUT - Scott Tomilson & John Dasilva
CloudIDSummit
 
CIS 2015 Session Management at Scale - Scott Tomilson & Jamshid Khosravian
CloudIDSummit
 
CIS 2015 So you want to SSO … Scott Tomilson & John Dasilva
CloudIDSummit
 
CIS 2015 Identity Relationship Management in the Internet of Things
CloudIDSummit
 

Recently uploaded (20)

PDF
Python basic programing language for automation
DanialHabibi2
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
July Patch Tuesday
Ivanti
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Python basic programing language for automation
DanialHabibi2
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
July Patch Tuesday
Ivanti
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 

CIS14: Developing with OAuth and OIDC Connect

  • 1. Developing  with  OAuth  and  OpenID   Connect   David  Chase   Senior  So9ware  Architect   Ping  Iden;ty  
  • 3. OAuth  or  OpenID  Connect,  which  one?  
  • 4. OAuth2.0   •  An  authoriza;on  grant  is  a  creden;al   represen;ng  the  resource  owner's   authoriza;on  to  access  its  protected   resources.  
  • 5. OpenID  Connect   •  OpenID  Connect  1.0  is  a  simple  iden;ty  layer  on   top  of  the  OAuth  2.0  [RFC6749]  protocol.  It   enables  Clients  to  verify  the  iden;ty  of  the  End-­‐ User  based  on  the  authen;ca;on  performed  by   an  Authoriza;on  Server,  as  well  as  to  obtain  basic   profile  informa;on  about  the  End-­‐User  in  an   interoperable  and  REST-­‐like  manner.  
  • 6. OAuth  or  OpenID  Connect,  which  one?   •  OAuth  is  for  authoriza;on   •  OpenID  Connects  adds  authen;ca;on  to   authoriza;on  
  • 7. Choosing  a  Grant  Type  for  OAuth   •  Authoriza;on  Code     •  Implicit   •  Resource  Owner  Creden;als     •  Refresh  Token     •  Client  Creden;als     •  Extension  (i.e.  SAML  2.0  Bearer)  
  • 8. Authoriza;on  Code     var  reques;fy  =  require('reques;fy');          reques;fy.post('hbp://example.com',  {                  redirect_uri:  'hbps%3A%2F%2Fexample.org%2callback',    response_type:'code',    client_id:'myId’,    scope:’read’,    state:’343msdjasd9k2’          })          .then(func;on(response)  {                  //  Get  the  response  body  (JSON  parsed  or  jQuery  object  for  XMLs)                  response.getBody();          });  
  • 9. Implicit   var  reques;fy  =  require('reques;fy');          reques;fy.post('hbp://example.com',  {                  redirect_uri:  'hbps%3A%2F%2Fexample.org%2callback',    response_type:’token',    client_id:'myId’,    scope:’read’,    state:’343msdjasd9k2’          })          .then(func;on(response)  {                  //  Get  the  response  body  (JSON  parsed  or  jQuery  object  for  XMLs)                  response.getBody();          });  
  • 10. Resource  Owner  Creden;als     var  reques;fy  =  require('reques;fy');          reques;fy.post('hbp://example.com',  {                  redirect_uri:  'hbps%3A%2F%2Fexample.org%2callback',    grant_type:’password',    username:’joe’,    password:’2Federate’,    client_id:'myId’,    scope:’read’,   })          .then(func;on(response)  {                  //  Get  the  response  body  (JSON  parsed  or  jQuery  object  for  XMLs)                  response.getBody();          });  
  • 11. Refresh  Token     var  reques;fy  =  require('reques;fy');          reques;fy.post('hbp://example.com',  {  grant_type:’refresh_token’,   client_id:’myid’,   client_secret:‘1955279925675241571’,   refresh_token:  ‘3MVG9lKcPoNINVBIPJjdw1J9LLM82HnFVVX19KY1uA5mu0   QqEWhqKpoW3svG3XHrXDiCQjK1mdgAvhCscA9GE’   })          .then(func;on(response)  {                  //  Get  the  response  body  (JSON  parsed  or  jQuery  object  for  XMLs)                  response.getBody();          });  
  • 12. Client  Creden;als     var  reques;fy  =  require('reques;fy');          reques;fy.post('hbp://example.com',  {                  redirect_uri:  'hbps%3A%2F%2Fexample.org%2callback',    grant_type:’client_creden;als’,        client_secret:’2Federate’,    client_id:'myId’,    scope:’read’,   })          .then(func;on(response)  {                  //  Get  the  response  body  (JSON  parsed  or  jQuery  object  for  XMLs)                  response.getBody();          });  
  • 14. Choosing  a  Grant  Type  for  OpenID   Connect   •  Authoriza;on  Code  Flow   •  Implicit  Flow     •  Hybrid  Flow  
  • 15. Authoriza;on  Code  Flow   1.  Client  prepares  an  Authen;ca;on  Request  containing  the  desired  request   parameters.   2.  Client  sends  the  request  to  the  Authoriza;on  Server.   3.  Authoriza;on  Server  Authen;cates  the  End-­‐User.   4.  Authoriza;on  Server  obtains  End-­‐User  Consent/Authoriza;on.   5.  Authoriza;on  Server  sends  the  End-­‐User  back  to  the  Client  with  an  Authoriza;on   Code.   6.  Client  requests  a  response  using  the  Authoriza;on  Code  at  the  Token  Endpoint.   7.  Client  receives  a  response  that  contains  an  ID  Token  and  Access  Token  in  the   response  body.   8.  Client  validates  the  ID  token  and  retrieves  the  End-­‐User's  Subject  Iden;fier.  
  • 16. Authoriza;on  Code  Flow   var  reques;fy  =  require('reques;fy');          reques;fy.post('hbp://example.com',  {                  redirect_uri:  'hbps%3A%2F%2Fexample.org%2callback',    response_type:'code',    client_id:'myId’,    scope:’read’,    state:’343msdjasd9k2’          })          .then(func;on(response)  {                  //  Get  the  response  body  (JSON  parsed  or  jQuery  object  for  XMLs)                  response.getBody();          });  
  • 17. Authoriza;on  Code  Token  Response   {        "access_token":  "SlAV32hkKG",        "token_type":  "Bearer",        "refresh_token":  "8xLOxBtZp8",        "expires_in":  3600,        "id_token":  "eyJhbGciOiJSUzI1NiIsImtpZCI6IjFlOWdkazcifQ.ewogImlzc            yI6ICJodHRwOi8vc2VydmVyLmV4YW1wbGUuY29tIiwKICJzdWIiOiAiMjQ4Mjg5            NzYxMDAxIiwKICJhdWQiOiAiczZCaGRSa3F0MyIsCiAibm9uY2UiOiAibi0wUzZ            fV3pBMk1qIiwKICJleHAiOiAxMzExMjgxOTcwLAogImlhdCI6IDEzMTEyODA5Nz            AKfQ.ggW8hZ1EuVLuxNuuIJKX_V8a_OMXzR0EHR9R6jgdqrOOF4daGU96Sr_P6q            Jp6IcmD3HP99Obi1PRs-­‐cwh3LO-­‐p146waJ8IhehcwL7F09JdijmBqkvPeB2T9CJ            NqeGpe-­‐gccMg4vfKjkM8FcGvnzZUN4_KSP0aAp1tOJ1zZwgjxqGByKHiOtX7Tpd            QyHE5lcMiKPXfEIQILVq0pc_E2DzL7emopWoaoZTF_m0_N0YzFC6g6EJbOEoRoS            K5hoDalrcvRYLSrQAZZKflyuVCyixEoV9GfNQC3_osjzw2PAithfubEEBLuVVk4            XUVrWOLrLl0nx7RkKU8NXNHq-­‐rvKMzqg"      }  
  • 18. The  ID  token  If  the  ID  Token  is  encrypted,  decrypt  it  using  the  keys  and  algorithms  that  the  Client  specified  during  Registra;on  that  the  OP  was  to  use  to  encrypt  the  ID  Token.  If  encryp;on   was  nego;ated  with  the  OP  at  Registra;on  ;me  and  the  ID  Token  is  not  encrypted,  the  RP  SHOULD  reject  it.   The  Issuer  Iden;fier  for  the  OpenID  Provider  (which  is  typically  obtained  during  Discovery)  MUST  exactly  match  the  value  of  the  iss  (issuer)  Claim.   The  Client  MUST  validate  that  the  aud  (audience)  Claim  contains  its  client_id  value  registered  at  the  Issuer  iden;fied  by  the  iss  (issuer)  Claim  as  an  audience.  The  aud   (audience)  Claim  MAY  contain  an  array  with  more  than  one  element.  The  ID  Token  MUST  be  rejected  if  the  ID  Token  does  not  list  the  Client  as  a  valid  audience,  or  if  it   contains  addi;onal  audiences  not  trusted  by  the  Client.   If  the  ID  Token  contains  mul;ple  audiences,  the  Client  SHOULD  verify  that  an  azp  Claim  is  present.   If  an  azp  (authorized  party)  Claim  is  present,  the  Client  SHOULD  verify  that  its  client_id  is  the  Claim  Value.   If  the  ID  Token  is  received  via  direct  communica;on  between  the  Client  and  the  Token  Endpoint  (which  it  is  in  this  flow),  the  TLS  server  valida;on  MAY  be  used  to  validate   the  issuer  in  place  of  checking  the  token  signature.  The  Client  MUST  validate  the  signature  of  all  other  ID  Tokens  according  to  JWS  [JWS]  using  the  algorithm  specified  in  the   JWT  alg  header  parameter.  The  Client  MUST  use  the  keys  provided  by  the  Issuer.   The  alg  value  SHOULD  be  the  default  of  RS256  or  the  algorithm  sent  by  the  Client  in  the  id_token_signed_response_alg  parameter  during  Registra;on.   If  the  JWT  alg  header  parameter  uses  a  MAC  based  algorithm  such  as  HS256,  HS384,  or  HS512,  the  octets  of  the  UTF-­‐8  representa;on  of  the  client_secret  corresponding  to   the  client_id  contained  in  the  aud  (audience)  Claim  are  used  as  the  key  to  validate  the  signature.  For  MAC  based  algorithms,  the  behavior  is  unspecified  if  the  aud  is  mul;-­‐ valued  or  if  an  azp  value  is  present  that  is  different  than  the  aud  value.   The  current  ;me  MUST  be  before  the  ;me  represented  by  the  exp  Claim.   The  iat  Claim  can  be  used  to  reject  tokens  that  were  issued  too  far  away  from  the  current  ;me,  limi;ng  the  amount  of  ;me  that  nonces  need  to  be  stored  to  prevent  abacks.   The  acceptable  range  is  Client  specific.   If  a  nonce  value  was  sent  in  the  Authen;ca;on  Request,  a  nonce  Claim  MUST  be  present  and  its  value  checked  to  verify  that  it  is  the  same  value  as  the  one  that  was  sent  in   the  Authen;ca;on  Request.  The  Client  SHOULD  check  the  nonce  value  for  replay  abacks.  The  precise  method  for  detec;ng  replay  abacks  is  Client  specific.   If  the  acr  Claim  was  requested,  the  Client  SHOULD  check  that  the  asserted  Claim  Value  is  appropriate.  The  meaning  and  processing  of  acr  Claim  Values  is  out  of  scope  for  this   specifica;on.   If  the  auth_;me  Claim  was  requested,  either  through  a  specific  request  for  this  Claim  or  by  using  the  max_age  parameter,  the  Client  SHOULD  check  the  auth_;me  Claim   value  and  request  re-­‐authen;ca;on  if  it  determines  too  much  ;me  has  elapsed  since  the  last  End-­‐User  authen;ca;on.  
  • 19. Before  you  start  coding…   hbp://openid.net/developers/libraries/     Libraries  list  for:     C,  C#,  Java,  PHP,  Python,  Ruby,  Javascript     And  Products…  
  • 20. ID  token   {        "iss":  "hbps://server.example.com",        "sub":  "24400320",        "aud":  "s6BhdRkqt3",        "nonce":  "n-­‐0S6_WzA2Mj",        "exp":  1311281970,        "iat":  1311280970,        "auth_;me":  1311280969,        "acr":  "urn:mace:incommon:iap:silver"      }  
  • 21. Implicit  Flow     Client  prepares  an  Authen;ca;on  Request  containing  the   desired  request  parameters.   Client  sends  the  request  to  the  Authoriza;on  Server.   Authoriza;on  Server  Authen;cates  the  End-­‐User.   Authoriza;on  Server  obtains  End-­‐User  Consent/Authoriza;on.   Authoriza;on  Server  sends  the  End-­‐User  back  to  the  Client   with  an  ID  Token  and,  if  requested,  an  Access  Token.   Client  validates  the  ID  token  and  retrieves  the  End-­‐User's   Subject  Iden;fier.  
  • 22. Calling  the  User  Info  Endpoint   GET  /userinfo  HTTP/1.1      Host:  server.example.com      Authoriza;on:  Bearer  SlAV32hkK  
  • 23. Claims   {        "sub":  "248289761001",        "name":  "Jane  Doe",        "given_name":  "Jane",        "family_name":  "Doe",        "preferred_username":  "j.doe",        "email":  "[email protected]",        "picture":  "hbp://example.com/janedoe/me.jpg"      }  
  • 24. More…  Member  Type  Descrip;on   sub  string  Subject  -­‐  Iden;fier  for  the  End-­‐User  at  the  Issuer.   name  string  End-­‐User's  full  name  in  displayable  form  including  all  name  parts,  possibly  including  ;tles  and  suffixes,  ordered  according  to  the  End-­‐User's  locale  and  preferences.   given_name  string  Given  name(s)  or  first  name(s)  of  the  End-­‐User.  Note  that  in  some  cultures,  people  can  have  mul;ple  given  names;  all  can  be  present,  with  the  names  being  separated  by  space   characters.   family_name  string  Surname(s)  or  last  name(s)  of  the  End-­‐User.  Note  that  in  some  cultures,  people  can  have  mul;ple  family  names  or  no  family  name;  all  can  be  present,  with  the  names  being   separated  by  space  characters.   middle_name  string  Middle  name(s)  of  the  End-­‐User.  Note  that  in  some  cultures,  people  can  have  mul;ple  middle  names;  all  can  be  present,  with  the  names  being  separated  by  space  characters.   Also  note  that  in  some  cultures,  middle  names  are  not  used.   nickname  string  Casual  name  of  the  End-­‐User  that  may  or  may  not  be  the  same  as  the  given_name.  For  instance,  a  nickname  value  of  Mike  might  be  returned  alongside  a  given_name  value  of  Michael.   preferred_username  string  Shorthand  name  by  which  the  End-­‐User  wishes  to  be  referred  to  at  the  RP,  such  as  janedoe  or  j.doe.  This  value  MAY  be  any  valid  JSON  string  including  special  characters  such   as  @,  /,  or  whitespace.  The  RP  MUST  NOT  rely  upon  this  value  being  unique,  as  discussed  in  Sec;on  5.7.   profile  string  URL  of  the  End-­‐User's  profile  page.  The  contents  of  this  Web  page  SHOULD  be  about  the  End-­‐User.   picture  string  URL  of  the  End-­‐User's  profile  picture.  This  URL  MUST  refer  to  an  image  file  (for  example,  a  PNG,  JPEG,  or  GIF  image  file),  rather  than  to  a  Web  page  containing  an  image.  Note  that  this   URL  SHOULD  specifically  reference  a  profile  photo  of  the  End-­‐User  suitable  for  displaying  when  describing  the  End-­‐User,  rather  than  an  arbitrary  photo  taken  by  the  End-­‐User.   website  string  URL  of  the  End-­‐User's  Web  page  or  blog.  This  Web  page  SHOULD  contain  informa;on  published  by  the  End-­‐User  or  an  organiza;on  that  the  End-­‐User  is  affiliated  with.   email  string  End-­‐User's  preferred  e-­‐mail  address.  Its  value  MUST  conform  to  the  RFC  5322  [RFC5322]  addr-­‐spec  syntax.  The  RP  MUST  NOT  rely  upon  this  value  being  unique,  as  discussed  in  Sec;on   5.7.   email_verified  boolean  True  if  the  End-­‐User's  e-­‐mail  address  has  been  verified;  otherwise  false.  When  this  Claim  Value  is  true,  this  means  that  the  OP  took  affirma;ve  steps  to  ensure  that  this  e-­‐mail   address  was  controlled  by  the  End-­‐User  at  the  ;me  the  verifica;on  was  performed.  The  means  by  which  an  e-­‐mail  address  is  verified  is  context-­‐specific,  and  dependent  upon  the  trust  framework  or  contractual   agreements  within  which  the  par;es  are  opera;ng.   gender  string  End-­‐User's  gender.  Values  defined  by  this  specifica;on  are  female  and  male.  Other  values  MAY  be  used  when  neither  of  the  defined  values  are  applicable.   birthdate  string  End-­‐User's  birthday,  represented  as  an  ISO  8601:2004  [ISO8601‑2004]  YYYY-­‐MM-­‐DD  format.  The  year  MAY  be  0000,  indica;ng  that  it  is  omibed.  To  represent  only  the  year,  YYYY  format   is  allowed.  Note  that  depending  on  the  underlying  pla€orm's  date  related  func;on,  providing  just  year  can  result  in  varying  month  and  day,  so  the  implementers  need  to  take  this  factor  into  account  to   correctly  process  the  dates.   zoneinfo  string  String  from  zoneinfo  [zoneinfo]  ;me  zone  database  represen;ng  the  End-­‐User's  ;me  zone.  For  example,  Europe/Paris  or  America/Los_Angeles.   locale  string  End-­‐User's  locale,  represented  as  a  BCP47  [RFC5646]  language  tag.  This  is  typically  an  ISO  639-­‐1  Alpha-­‐2  [ISO639‑1]  language  code  in  lowercase  and  an  ISO  3166-­‐1  Alpha-­‐2  [ISO3166‑1]   country  code  in  uppercase,  separated  by  a  dash.  For  example,  en-­‐US  or  fr-­‐CA.  As  a  compa;bility  note,  some  implementa;ons  have  used  an  underscore  as  the  separator  rather  than  a  dash,  for  example,  en_US;   Relying  Par;es  MAY  choose  to  accept  this  locale  syntax  as  well.   phone_number  string  End-­‐User's  preferred  telephone  number.  E.164  [E.164]  is  RECOMMENDED  as  the  format  of  this  Claim,  for  example,  +1  (425)  555-­‐1212  or  +56  (2)  687  2400.  If  the  phone  number   contains  an  extension,  it  is  RECOMMENDED  that  the  extension  be  represented  using  the  RFC  3966  [RFC3966]  extension  syntax,  for  example,  +1  (604)  555-­‐1234;ext=5678.   phone_number_verified  boolean  True  if  the  End-­‐User's  phone  number  has  been  verified;  otherwise  false.  When  this  Claim  Value  is  true,  this  means  that  the  OP  took  affirma;ve  steps  to  ensure  that   this  phone  number  was  controlled  by  the  End-­‐User  at  the  ;me  the  verifica;on  was  performed.  The  means  by  which  a  phone  number  is  verified  is  context-­‐specific,  and  dependent  upon  the  trust  framework  or   contractual  agreements  within  which  the  par;es  are  opera;ng.  When  true,  the  phone_number  Claim  MUST  be  in  E.164  format  and  any  extensions  MUST  be  represented  in  RFC  3966  format.   address  JSON  object  End-­‐User's  preferred  postal  address.  The  value  of  the  address  member  is  a  JSON  [RFC4627]  structure  containing  some  or  all  of  the  members  defined  in  Sec;on  5.1.1.   updated_at  number  Time  the  End-­‐User's  informa;on  was  last  updated.  Its  value  is  a  JSON  number  represen;ng  the  number  of  seconds  from  1970-­‐01-­‐01T0:0:0Z  as  measured  in  UTC  un;l  the  date/ ;me.  
  • 25. Handling  Refresh  Tokens  and   Managing  Sessions   •  Web  Server/Applica;on   – Refresh  Token   •  Mobile/Javascript  Browser  Client   – No  Refresh  Token  
  • 26. Concerns   •  Losing  Tokens  (Open  Redirects)   •  Losing  client  creden;als   •  OAuth  isn’t  SSO!  
  • 27. Ques;ons  /  References   Confidential — do not distribute Copyright © 2013 Ping Identity Corp.All rights reserved. 27 OpenID Connect http://openid.net/connect OAuth 2.0 http://oauth.net/2 JSON Web Token (JWT) http://tools.ietf.org/html/draft-ietf-oauth-json-web-token