authgear-server icon indicating copy to clipboard operation
authgear-server copied to clipboard

Specify OpenCV Facial Recognition

Open pkong-ds opened this issue 1 year ago • 1 comments

This issue is the specification of how opencv-fr is going to be included in authgear. Note that it is just a proposal, and no plan to actually include it in prod for now.

OpenCV Facial Recognition

  • Configs
    • authgear.yaml
    • authgear.secrets.yaml
  • Interaction
    • Signup
    • Login
    • Settings Add Face
  • References

Configs

authgear.yaml

Here is the configurations to include OpenCV Facial Recognition as your authentication method:

authentication:
  identities:
  - opencv_fr

identity:
  opencv_fr:
    default_collection_id: my-opencv-fr-collection-id
    liveness_check: true
  • authentication.identities: Include "opencv_fr" in this list to enable opencv_fr
  • identity.opencv_fr.default_collection_id: Optional. string. If specified, authgear will always search/create/remove persons from this collection.
  • identity.opencv_fr.liveness_check: Optional. bool. Default to false. Whether authgear will check liveness of image when searching persons by image.

authgear.secrets.yaml

- data:
  api_key: my-opencv-fr-api-key
  key: opencv_fr

Interaction with authgear

Signup

sequenceDiagram
    participant ua as User Agent (Alice)
    participant ag as IdP (Authgear) <br/> https://example.authgear.cloud
    participant fr as FRP (OpenCV-FR) <br/> https://<region>.opencv.fr/
    ua->>+ag: [1] Request to signup https://https://example.authgear.cloud/signup
    ag->>+fr: [2] Create <Person> POST https://<region>.opencv.fr/person
    Note right of ag: Alice provides face image
    fr->>-ag: [3] <Person> Created
    ag->>-ua: [4] Response with signup success 

Login

sequenceDiagram
    participant ua as User Agent (Alice)
    participant ag as IdP (Authgear) <br/> https://example.authgear.cloud
    participant fr as FRP (OpenCV-FR) <br/> https://<region>.opencv.fr/
    ua->>+ag: [1] Request to login https://https://example.authgear.cloud/login
    ag->>+fr: [2] Search <Person> POST https://<region>.opencv.fr/search
    Note right of ag: Alice provides face image
    Note over fr: POST /search-live-face if liveness_check=true
    fr->>-ag: [3] <Person> Found
    ag->>-ua: [4] Response with login success 

Settings Add Face

Same as signup

References

pkong-ds avatar Oct 04 '24 04:10 pkong-ds

Issue outdated, will close

pkong-ds avatar Oct 21 '24 07:10 pkong-ds