Okta Workflows how-to guides are questions and solutions from weekly neighborhood workplace hours, MacAdmins Workflows Slack channel, and different locations. Learn all different how-to guides.
On to the query.
How one can decide person sign-in location data?
This how-to is predicated on WorkflowsTip #8, from Ashwin Ramnarayanan, Options Engineer at Okta.
Figuring out location
While you use the Okta – Consumer Signal In Try occasion card, the occasion has details about person’s geolocation.
The Occasion Particulars JSON part has data that additionally consists of the geolocation data.
To retrieve the situation data, use the Get A number of card with the shopper.geographicalContext path.
For instance, if a person indicators in from San Diego, the JSON would possibly appear to be this:
{ "metropolis": "San Diego", "state": "California", "nation": "United States", "postalCode": "92014", "geolocation": { "lat": 32.7157, "lon": -117.1610 } }
The opposite path within the Get A number of card, the shopper.consequence, holds data on whether or not the sign-in was profitable or not.
JSOM from a failed sign-in:
{ "outcome": "FAILURE", "motive": "INVALID_CREDENTIALS" }
JSON from a profitable sign-in:
Subsequent, you’ll see tips on how to construct a movement that sends a notification when a person indicators in from a specific nation.
Sending a sign-in notification
On this part, you’ll replace the movement to get a notification when a sign-in occurs from a selected nation.
When a person indicators in from a rustic within the Workflows desk (proven beneath), you wish to get notified.
The movement seems like this:
The movement has the next playing cards:
- The Consumer Signal In Try occasion playing cards fires when a person makes an attempt a sign-in
- The Get A number of card retrieves nation and sign-in consequence data. The cardboard is up to date to retrieve the nation title and sign-in consequence instantly (within the first part, you retrieved the JSON). Paths to retrieve the precise values:
- shopper.geographicalContext.nation
- consequence.outcome
- The Search Rows card searches if a rustic from which a sign-in occurred matches a rustic listed within the desk
- The primary Proceed If card checks if a rustic was matched. If sure, the movement continues
- The second Proceed If playing cards checks if a sign-in was profitable. If sure, the movement continues
- The Compose card creates a message with sign-in data. You may ship the message to Slack, e-mail or SMS
What you realized
You realized tips on how to decide a sign-in location data. You additionally realized tips on how to construct a movement that enables to ship a notification when a sign-in occurs from a specific nation.