Prerequisites for Using OAuth 2.0 with HIN eID

This chapter describes the prerequisites required for a successful implementation of OAuth 2.0 with HIN eID. Here, you will find information on the technical, security-related, and functional requirements that must be met to use OAuth 2.0 with HIN.

What is Required for Integration with OAuth?

To access a protected application, a HIN ID is required:

  • In the Authorization Code Flow, access is granted on behalf of a user who has authenticated with their HIN ID.
  • In the Client Credentials Flow, a technical user is used, for which a HIN ID is issued.

Additionally, a Client ID issued by HIN Support is required. For the Client Credentials Flow, a Client Secret is needed, which can be generated on apps.hin.ch.

Tabular Overview of Prerequisites

RequirementsAuthorization Code FlowClient Credentials Flow
User InteractionYes, user must log in and grant accessNo, no user interaction required
Client IDYes, to identify the applicationYes, to identify the application
Client SecretCreated and provided by HINMust be generated via apps.hin.ch
Authorization CodeYes, received after user loginNo, not used
Redirect URIYes, URL for redirecting with Access CodeNo, not required
Access TokenYes, after exchanging the authorization codeYes, directly after requesting with client_credentials
StateMust be provided, content is irrelevantMust be provided, content is irrelevant
Grant Typeauthorization_code (Authorization Code Flow)client_credentials (Application access without user)
Token GroupYes, always requiredYes, always required
Nevis RoleYes, always requiredYes, always required