Skip to content

Auth & sessie

Interne GraphQL-queries: Auth & sessie. Vereist authenticatie.

Endpoint: POST https://graphql.persmonitor.nl/graphql

Intern · VPN

Deze pagina's zijn op productie alleen via VPN bereikbaar onder /internal/.


currentEnvironment

Current environment for this session (requires Authorization Bearer token). If the session has none set yet, the API picks the first environment the user has access to and persists that as the session default.

Return type: Environment

Authenticatie: Ingelogde gebruiker (sessie- of API-token)

Geen argumenten.

Voorbeeld:

graphql
query CurrentEnvironment {
  currentEnvironment {
    # selecteer velden uit het return type
  }
}

me

The currently logged-in user. Null when not authenticated. Send the Authorization: Bearer <token> header (token is stored by the frontend).

Return type: User

Authenticatie: Ingelogde gebruiker (sessie- of API-token)

Geen argumenten.

Voorbeeld:

graphql
query Me {
  me {
    # selecteer velden uit het return type
  }
}

mySessions

Active sessions for the current user (requires Authorization Bearer token).

Return type: [AuthSession]

Authenticatie: Ingelogde gebruiker (sessie- of API-token)

Geen argumenten.

Voorbeeld:

graphql
query MySessions {
  mySessions {
    # selecteer velden uit het return type
  }
}

oauthProviders

Beschikbare OAuth-providers en hun login-URL's. Stuur de browser naar loginUrl om de OAuth-flow te starten. Vereist API-token met scope auth:login.

Return type: [OAuthProvider!]

Authenticatie: API-token met scope (auth:login, auth:register, …)

Argumenten:

ArgumentTypeVerplichtBeschrijving
returnToString!JaURL van jouw app waar de gebruiker naartoe wordt teruggestuurd na OAuth (met token en refreshToken als query-parameters).

Voorbeeld:

graphql
query OauthProviders {
  oauthProviders(returnTo: $returnTo) {
    # selecteer velden uit het return type
  }
}

sessionValid

Whether the current token is still valid. Send the Authorization: Bearer <token> header (token is stored by the frontend, e.g. monitor.persmonitor.nl). Use for a quick check on app load.

Return type: Boolean!

Authenticatie: Ingelogde gebruiker (sessie- of API-token)

Geen argumenten.

Voorbeeld:

graphql
query SessionValid {
  sessionValid {
    # selecteer velden uit het return type
  }
}