| | | 1 | | using ArturRios.Util.WebApi.Security.Enums; |
| | | 2 | | |
| | | 3 | | namespace ArturRios.Util.WebApi.Security.Configuration; |
| | | 4 | | |
| | | 5 | | /// <summary>Consolidated options controlling how <c>AuthenticationMiddleware</c> reads and validates the request token. |
| | | 6 | | public class AuthenticationOptions |
| | | 7 | | { |
| | | 8 | | /// <summary>Where the token is read from. Defaults to <see cref="TokenSource.Header"/>.</summary> |
| | 24 | 9 | | public TokenSource Source { get; set; } = TokenSource.Header; |
| | | 10 | | |
| | | 11 | | /// <summary>The cookie name used when <see cref="Source"/> is <see cref="TokenSource.Cookie"/> or <see cref="TokenS |
| | 24 | 12 | | public string CookieName { get; set; } = "access_token"; |
| | | 13 | | |
| | | 14 | | /// <summary>Whether the app's own HMAC JWT is accepted. Defaults to <see langword="true"/>.</summary> |
| | 25 | 15 | | public bool EnableJwt { get; set; } = true; |
| | | 16 | | |
| | | 17 | | /// <summary>Whether Google ID tokens are accepted. Defaults to <see langword="false"/>. Requires <see cref="GoogleC |
| | 15 | 18 | | public bool EnableGoogle { get; set; } |
| | | 19 | | |
| | | 20 | | /// <summary>How the user is resolved for a valid app JWT. Defaults to <see cref="JwtValidationMode.ClaimsOnly"/>.</ |
| | 29 | 21 | | public JwtValidationMode JwtMode { get; set; } = JwtValidationMode.ClaimsOnly; |
| | | 22 | | |
| | | 23 | | /// <summary>The accepted Google OAuth client IDs (token audiences). Required when <see cref="EnableGoogle"/> is <se |
| | 32 | 24 | | public IList<string> GoogleClientIds { get; set; } = new List<string>(); |
| | | 25 | | } |