Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provides support for token refresh #381

Open
wants to merge 3 commits into
base: development
Choose a base branch
from

Conversation

antoineatstariongroup
Copy link
Contributor

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following the COMET-SDK code style guidelines
  • I have provided test coverage for my change (where applicable)

Description

  • Login endpoint provide 2 token: one for the access, one for the refresh
  • Add new endpoint (/refresh) to allow generation of new token based on the refresh one

if (!appConfigService.IsAuthenticationSchemeEnabled(JwtBearerDefaults.LocalAuthenticationScheme))
{
context.Response.StatusCode = (int)HttpStatusCode.Forbidden;
await context.Response.WriteAsync("Local JWT Authentication is disable.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

disabled


if (refreshExpirationMinutes <= 0)
{
throw new ConfigurationErrorsException("The Authentication:LocalJwtBearer:RefreshExpirationMinutes setting must be strickly greater than 0");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stricktly

@@ -60,8 +60,9 @@
"IsEnabled": false,
"ValidIssuer": "CDP4-COMET",
"ValidAudience": "localhost:5000",
"SymmetricSecurityKey": "needs-to-be-updated-with-a-secret",
"TokenExpirationMinutes": 150
"SymmetricSecurityKey": "needs-to-be-updated-with-a-secret",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please make sure to update the wiki with this information

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Configuration page updated, gonna update ICD


/// <summary>
/// The purpose of the <see cref="JwtTokenService"/> is to generate a JWT token based on the provided authenticated
/// The purpose of the <see cref="JwtTokenService" /> is to generate a JWT token based on the provided authenticated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

incomplete sentence

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants