c# - Adding a new grant_type in ASP.NET Identity? -
i'm using asp.net identity in web api 2 project. have , running fine authenticating username , password using following example:
grant_type=password&username=alice%40example.com&password=password1!
and working fine.
now, service can called mobile app , want give user option able log in passcode. i've added 2 fields (passcode , device id) user table , have extended userstore able retrieve user based on information.
my question how allow user supply passcode? need them able log in either password or passcode, thinking of sending following passcode:
grant_type=passcode&username=alice%40example.com&passcode=1234&deviceid=abcdef
and depending on grant_type can either query user store password or passcode. throws error (unsupported_grant_type
) , having quick search looks these predefined values can't add new one?
am able add new grant_type
or have stick password
, have additional field in post data stating if it's passcode?
thanks
adding grant_type
doesn't seem major issue. there though: compliance. every oauth endpoint has specific set of allowed grant_type
s. if add one, bypassing standard, lead problems others implementing it.
Comments
Post a Comment