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

Authorization scenarios and mechanisms analysis #763

Open
martinothamar opened this issue Sep 11, 2024 · 0 comments
Open

Authorization scenarios and mechanisms analysis #763

martinothamar opened this issue Sep 11, 2024 · 0 comments
Assignees
Labels
status/draft Status: When you create an issue before you have enough info to properly describe the issue.

Comments

@martinothamar
Copy link
Contributor

martinothamar commented Sep 11, 2024

Description

We need to get an overview of common authorization scenarios and mechanisms that exist today and will be implemented into the platform. Here are some movements happening where there are questions related to authorization

  • Simplified integration for system owners: Forenklet integrasjon for sluttbrukersystemer digdir/roadmap#84
    • Client systems could be "fagsystemer", "sluttbrukersystemer", "leverandører" etc
  • "System users": Fremtidig løsning for sluttbrukersystemer altinn-authentication#200
  • Background processing/user independent actions in the process engine in Altinn.App
    • IServiceTask implementations (may run in background, may retry operations on failure)
    • Different kinds of payment processing
    • Invoke other product/platform APIs such as
      • PDF generator
      • Authorization Delegation/AccessControl
      • eFormidling
      • Correspondence
      • Storage
      • Notifications
      • Events
  • Maskinporten, PlatformAccessToken are scoped to organization, not app, though some apps want further isolation
  • Maskinporten -> Altinn token exchange is cumbersome
    • Options
      • Not have token exchange
      • Do token exchange internally in the platform

In scope

No response

Out of scope

No response

Additional Information

No response

Analysis

User flow 1

Log into tt02 manually, then navigate to an app

  • Log into tt02.altinn.no - altinnContext cookie is set (this is still A2 I think)
    • Some base64 stuff?
  • Choose party/reportee - altinnContext and altinnReportee cookies are set (this is still A2 I think)
  • Go to Altinn 3 app URL directly - 302 redirect to platform.tt02.altinn.no/authentication/api/v1/authentication then back again
    • AltinnStudioRuntime is set by Authn API, it is a JWT, see below
  • Frontend renders party selection
    • Queries user, parties and current party (/profile/user, /parties, /authorization/parties/current)
  • Party selection invokes PUT /parties/{partyId}, AltinnPartyId cookie is set
  • App is rendered

JWT token claims:

{
  "nameid": "<int>",
  "urn:altinn:userid": "<int>",
  "urn:altinn:partyid": <int>,
  "urn:altinn:authenticatemethod": "IdportenTestId",
  "urn:altinn:authlevel": 3
}

Q:

  • The partyid claim in the auth cookie can differ from altinnReportee and AltinnPartyId, how does this stay consistent?

Mechanisms for authorization accepted by apps APIs

  • User token (logged in through Altinn)
    • Context: person, and party through party selection
  • Maskinporten token
    • Context: org

Platform and Core APIs

  • Storage - user token + APIM subscription key
    • User token comes from IUserTokenProvider which in reality is either the AltinnStudioRuntime cookie or the auth header, so it needs the HTTP Context directly
  • Notifications - PlatformnAccessToken
  • Events - user token + PlatformAccessToken + APIM subscription key
  • Profile - user token + PlatformAccessToken + APIM subscription key

Conclusion

No response

@martinothamar martinothamar added the status/draft Status: When you create an issue before you have enough info to properly describe the issue. label Sep 11, 2024
@martinothamar martinothamar self-assigned this Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/draft Status: When you create an issue before you have enough info to properly describe the issue.
Projects
Status: 👷 In Progress
Development

No branches or pull requests

1 participant