You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 27, 2019. It is now read-only.
App sees there’s no token in keychain, or makes a request for directory info with expired token and receives 401
Log in with Digits (enter phone number, receive verification code, enter verification code)
Send OAuth credentials to server
Server verifies with Digits API
Look up existing user by Digits user id
If user does not exist, create one
Generate new JWT*, assign it to user, send it back
Confirm that the phone number is correct****
Make request for directory info with token
If it's a 403, initiate access request** and optionally wipe any previously downloaded directory data
To determine scopes for token, look for member with same phone number as user
If one exists, grant directory-read scopes
**
Send request with token and desired scopes (or some description of intent) to create access request
Server looks up user from token, creates and returns access request with endpoints to add Facebook and Twitter accounts and toggle notifications
Phone prompts user to expedite the process by logging into a Facebook or Twitter account.*** Alternatively, go to the front office to be added.
Set a key in NSUserDefaults that indicates an access request is open. When this key is set, the app will check the status of the access request whenever the app enters the foreground. If it has been approved, call the refresh token endpoint to receive a new token with updated scopes. Display a message (possibly received from the access request object itself, set by an admin?).
***
Log in via social
Use endpoint from access request response to send OAuth credentials to server
Server verifies OAuth credentials
Update access request / user record with social profile
Phone tells user (by name) that the request is being reviewed, and gives option to be notified when it’s done.
Use endpoint from access request response to toggle notifications
****
App says “Hello, ${firstName}!” with buttons for confirming and saying “I’m not ${firstName} ${lastName}!”
If user taps “That’s not me,” revoke token and start request process** with some meta info describing phone number conflict
Granting Access
Internal app is provisioned with symmetric API key.
API key and a first name (for record keeping) is exchanged for a JWT
Internal app receives notifications for new access requests (5 minute delay to give time to add social profile)
Reads and updates access requests from JSON API authenticated with token
Scopes cannot be granted directly; they are calculated based on conditions. For directory read access, the condition is defined in (*). Later, we could expand this to a roll-based system, which would map users to roles to scopes, allowing for more custom behavior (and more efficient token creation). So before approving an access request for directory-read scopes, you’d have to add a member to ACS with the phone number and sync it to our API.
Because of number 5 above, the server should ensure that the conditions for granting scopes are met before actually approving the request
Upon approving or denying, a message can be set for the request. The server may, depending on the user’s settings, send a push notification that the request has been approved or denied.
The text was updated successfully, but these errors were encountered:
Requesting Access
**
***
****
Granting Access
The text was updated successfully, but these errors were encountered: