Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add authN layer #15

Open
kislerdm opened this issue Feb 4, 2023 · 2 comments
Open

Add authN layer #15

kislerdm opened this issue Feb 4, 2023 · 2 comments
Assignees
Labels
backend Core logic infrastructure Deployment and infra including CI and automation webui WebUI frontend

Comments

@kislerdm
Copy link
Owner

kislerdm commented Feb 4, 2023

Context

As a user, I want to have access to better model(s) and advanced features.

  • Fine-tuned models are paid, hence an "authentication wall" filter shall be set to keep the costs under control
  • Non-guest users data shall be used to improve the product quality

Problem

Authentication layer is required.

Proposed Solution

Implement pass-wordless authentication using Auth0:

  • email with an auth code
  • 3rd party IdPs:
    • GitHub
    • Google

Note that we maintain the option for a user to assume the "guest role", i.e. no authentication.

Flowchart

flowchart LR
    subgraph App
        trigger[Button 'Generate Diagram'] --> cache
        cache --> cacheGuest{Guest prefernece}
        cacheGuest -- No --> cacheAuth{JWT found}
        download[Button 'Download'] --> diagram[Diagram SVG]
    end
    subgraph Auth[Authentication Service]
        authFlow{Is IdP?}
        authFlow -- No --> email
        email[Email flow] --> SMTP
        email --> Logic
        Logic --> db[(Userbase)]
    end

    user((User)) --> trigger
    user --Download generated diagram--> download
    server --> diagram
    cacheGuest -- Yes --> server[Server: Core]
    cacheAuth --Yes--> server
    cacheAuth --No--> Logic
    user -- Authenticates --> authFlow
    user -- Enters email --> email
    user -- Enters access code --> Logic
    SMTP -- Sends access code --> userEmail(((User email server)))
    user -- Fetch access code --> userEmail
    Logic -- Returns JWT --> cache
    authFlow -- Yes --> IdP(((3rd party IdP)))
    user -- Confirms usage --> IdP
    IdP -- Configrms authentication --> Logic
Loading

### References

- Auth0
- API GW AuthN
- webclient logic with vanilla js:
~~ - auth0 docu~~
~~ - auth0 user's blog~~

Acceptance Criteria

  • Users are prompted to login screen upon the first click of the button "Generate Diagram"
  • Authenticated user's ID is propagated to the backend
    - Auth0 authN is plugged into the API GW
  • API GW request cognito authorisation is set
@kislerdm kislerdm converted this from a draft issue Feb 4, 2023
@kislerdm kislerdm added backend Core logic webui WebUI frontend infrastructure Deployment and infra including CI and automation labels Feb 4, 2023
@kislerdm kislerdm added this to the MVP-enhancement milestone Feb 4, 2023
@kislerdm kislerdm moved this to Todo in diagramastext Feb 11, 2023
@kislerdm kislerdm changed the title As a developer, I want to keep track of the number of users Add authN layer Feb 11, 2023
@kislerdm kislerdm removed the status in diagramastext Feb 11, 2023
@kislerdm kislerdm modified the milestones: MVP-enhancement, v0.0.4, v0.0.3 Feb 14, 2023
@kislerdm
Copy link
Owner Author

The auth0 account was created.

@kislerdm
Copy link
Owner Author

It was identified that unfortunately the auth0 free plan does not include passwordless authentication. On that basis, aws cognito to be used instead.

References

@kislerdm kislerdm modified the milestones: v0.0.3, v0.0.4, v0.0.5 Mar 22, 2023
@kislerdm kislerdm modified the milestones: v0.0.5, v0.0.6 Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Core logic infrastructure Deployment and infra including CI and automation webui WebUI frontend
Projects
Status: Todo
Development

No branches or pull requests

2 participants