How to get SAML token from OKTA from .NET web service code without using browser? -
we have hybrid mobile app built kendo ui , backend .net web service. calls ui through ajax. need integrate app okta user authentication, not sure how saml token okta directly web service call.
we implemented call adfs (active endpoint) web service saml token using windows identity framework , works.
if can share experience or point out solution, appreciated!
you can use following sequence obtain saml assertion:
1) can use /api/v1/authn establish sessiontoken. require user credentials. sample request like:
{ "username": "john.doe@foo.com", "password": "mypa$$word", "relaystate": "/myapp/some/deep/link/i/want/to/return/to", "options": { "multioptionalfactorenroll": false, "warnbeforepasswordexpired": false } }
response return sessiontoken value.
2) use value input, can use /api/v1/sessions?additionalfields=cookietoken return cookietoken
request this:
{ "sessiontoken": "1234123dgsabdasdbasdbaasbdasdb-abcdeaerasdlzxk" }
response contain cookietoken value
3) can use app sso url trigger saml - , attach one-time cookietoken @ end saml assertion. if paste url in browser, log saml-enabled app.
sample url be:
Comments
Post a Comment