Skip to content

Commit

Permalink
fix for some provider return birthdate:null in userInfo
Browse files Browse the repository at this point in the history
Signed-off-by: Li Chaoran <[email protected]>
  • Loading branch information
pkking authored and schlenk committed Nov 11, 2022
1 parent f4a483d commit 9896e2e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/oic/oic/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ class OpenIDSchema(Message):
def verify(self, **kwargs):
super().verify(**kwargs)

if "birthdate" in self:
if "birthdate" in self and self["birthdate"]:
# Either YYYY-MM-DD or just YYYY or 0000-MM-DD
try:
time.strptime(self["birthdate"], "%Y-%m-%d")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_oic_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def _eq(l1, l2):


def test_openidschema():
inp = '{"middle_name":null, "updated_at":"20170328081544", "sub":"abc"}'
inp = '{"middle_name":null, "updated_at":"20170328081544", "sub":"abc", "birthdate": null}'
ois = OpenIDSchema().from_json(inp)
assert ois.verify() is False

Expand Down

0 comments on commit 9896e2e

Please sign in to comment.