# Authentication with OpenID Connect
OpenID Connect for Servers is the preferred way to authenticate with the Pismo platform. It provides greater security guarantees in service communications than [basic authentication using client credentials](https://developers.pismo.io/pismo-docs/docs/basic-authentication-with-client-credentials). In addition, OpenID Connect supports multi-tenancy. This means that, for example, you can give a [third party access](https://developers.pismo.io/pismo-docs/docs/third-party-authentication-with-openid) to only a specific set of endpoints within your organization. To request an access token, use the [Get\_OpenID\_access\_token](https://developers.pismo.io/pismo-docs/reference/post-passport-v1-oauth2-token) endpoint.
# Server authentication
During onboarding to production, you must generate at least one pair of public and private keys for OpenID authentication. Then, you must generate and sign a **JSON Web Token** (JWT) for each key pair that you generate. For more information about JWTs, refer to [Generate your JWT](#generate-your-jwt).
1. Use the [OpenSSL](https://www.openssl.org/) toolkit to generate a private key and a public key, using the following commands:
```text Generating private and public keys
Generate a private key:
$ openssl genpkey -out rsakey.pem -algorithm RSA -pkeyopt rsa_keygen_bits:2048
Generate a public key based on the private key yougenerated:
$ openssl rsa -in rsakey.pem -out rsa.pub -pubout -outform PEM
```
2. Store your private key securely, and upload the public key to Control Center. For details on the upload process, refer to the Control Center [OpenID Connect authentication](https://developers.pismo.io/pismo-docs/docs/openid-configurations) guide.
3. Generate your JWT using the private key associated with the pubic key you shared using the [claims values here](#generate-your-jwt).
4. Request an access token using the endpoint [Get OpenID access token](https://developers.pismo.io/pismo-docs/reference/post-passport-v1-oauth2-token-1)
| Claim (key) | Type | Mandatory | Value | Description |
|---|---|---|---|---|
| alg | Fixed string value | Yes | RS256 | |
| typ | Fixed string value | Yes | JWT | |
| iss | Fixed string value | Yes | This is the verifier Issuer. This value is provided by Pismo, automatically generated by Control Center when a user creates a new credential. | |
| sub | Fixed string value | Yes | This is the verifier Subject. This value is provided by Pismo, automatically generated by Control Center when a user creates a new credential. | |
| aud | Fixed string value | Yes | This is the verifier Audience. This value is provided by Pismo, automatically generated by Control Center when a user creates a new credential. | |
| iat | Timestamp number | Yes | ex: 1697044489 | The current time in seconds since the UNIX epoch. |
| exp | Timestamp number | Yes | ex: 1697048089 | The time in seconds since the UNIX epoch at which the token expires. It can be a maximum of 3600 seconds later than the `iat`. |
| tenant\_id | Fixed string value | Yes | ex: tn\_example | The unique tenant identifier of the user/token. Value provided by Pismo, automatically generated by Control Center when a new OpenID key is registered. This is not to be confused with the Org ID. |
| uid | String value | Yes (refer to [Endpoints that require an account-specific token](https://developers.pismo.io/pismo-docs/reference/endpoints-that-require-an-account-specific-token)) | ex: 123456 | The Account ID of the Pismo customer. If you want a token without Account ID, do not send the claim **uid** on the JWT. |
| pismo | Object type | Yes | ex:\ "pismo": \{\ "**group**": "*pismo-v1:sample-group:rw,pismo-v1:sample-group2:rw*"\ }, | The identifier of the group that you want your token to have access to. A group has access to a certain subset of endpoints. You can add more than one group, separated by a comma. You can find the list of valid groups on Control Center under the section **API permission groups** which is inside the Menu/Organization. Otherwise, contact your Pismo representative. For full details on API permission groups, refer to the [API permission groups](https://developers.pismo.io/pismo-docs/docs/cc-api-permission-groups) guide. |
| customClaims | Object type | No | "customClaims": \{\ "custom1": "someValue",\ "userexample": "myusername"\ }, | Optional custom claims. |