- Print
- DarkLight
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
JSON Web Token
Using JSON Web token will make the Safran API depend on an Identify Platform such as the Microsoft Identity Platform or a Serverless Authentication.
A JSON Web Token (JWT) is a compact, URL-safe means of representing claims to be transferred between two parties. It is commonly used for authentication and information exchange
The Safran API authentication methods using JSON Web Token support the OAuth 2.0, which stands for “Open Authorization".
Setup
- Internet Information Service (IIS) Manager
- The setup is similar to what is done for “No Authentication”.
- The setup is similar to what is done for “No Authentication”.
- Within the “application.json” file found in your file folder:
- Make sure that the “authentication mode” setting is set to “jsonwebtoken”.
- Make sure that the “authentication mode” setting is set to “jsonwebtoken”.
- In addition to the authentication type there is also an element “jsonwebtoken” this can hold 3 elements:
- “key”
- This is a key used to sign and encrypt the jsonwebtoken.
- This is unused when using an Identity Platform, it is required when “Not using Authorisation Server”
- “Issuerclaim”, “Issuer” or “iss”
- In the context of JSON Web Tokens (JWTs), the issuer claim (often abbreviated as “iss”) serves two main purposes:
- Identification of the Issuer: The “iss” claim is a string that identifies the principal (entity) that issued the JWT. This can be a human user, an organization, or a service. For example, if a user logs in and receives a JWT, the issuer would be the authentication service or server that generated the token.
- Preventing Token Abuse: By including the issuer information, JWTs can prevent abuse. When a service receives a JWT, it can verify the issuer to ensure that the token was indeed issued by a trusted party. This helps prevent unauthorized tokens from being accepted.
- In summary, the “iss” claim provides basic context about the JWT’s origin and helps maintain security and trust in token-based authentication systems.
- This setting could be left blank, but that is not recommended.
- In the context of JSON Web Tokens (JWTs), the issuer claim (often abbreviated as “iss”) serves two main purposes:
- “Audienceclaim” or “aud”
- In the context of JSON Web Tokens (JWTs), the audience clain (often abbreviated as “aud”) serves two main purposes:
- Recipient Identification: The “aud” claim identifies the recipients for which the JWT is intended. It specifies who should process the token. For example, if your application receives a JWT, it can check the “aud” claim to ensure that it was indeed intended for this API and not another one.
- Preventing Token Abuse: By including the “aud” claim, JWTs prevent abuse. If an attacker tries to reuse a token meant for a different audience, the recipient (this API) can reject it based on the mismatched “aud” value.
- In summary, the “aud” claim helps maintain security and ensures that tokens are used only by their intended recipients.
- In the context of JSON Web Tokens (JWTs), the audience clain (often abbreviated as “aud”) serves two main purposes:
- “key”
Example, AppSetting
"AppSettings": {
"SafranWebApiAuthenticationType": "jsonwebtoken",
"jsonwebtoken": {
"key": "ThisIsMySecretKey2749C6AE486C6E783BBADF7F33333",
"iss": "This is my issuer",
"aud": "Safran Integration API"
}
},
Was this article helpful?