Skip to content

How to implement a custom LifetimeValidator, struggles in syntax #391

@tscaff

Description

@tscaff

Good afternoon.

I am attempting to implement a custom lifetime validator for our harmony core service to adapt for possible offline conditions with our identity service.

I have followed examples that are written in C# to try to do this but I cannot get the DBL compiler to accept my adjustments.

I'm getting the following error message when I am trying to assign the custom validator to my token validation parameters.

%DBL-E-REQPARM, Missing required parameter 1 in routine GetRequiredService : & }

Following is the source code line where the assignment is being made

        lambda configJwt(o)
		begin
			o.RequireHttpsMetadata = false
            o.IncludeErrorDetails = true
            o.ClaimsIssuer = AuthenticationTools.GetIssuer()
            o.Audience = AuthenticationTools.GetAudience()
            o.TokenValidationParameters = new TokenValidationParameters()
            &    {
            &    ValidateIssuer = true,
            &    ValidIssuer = AuthenticationTools.GetIssuer(),
            &    ValidateAudience = true,
            &    ValidAudience = AuthenticationTools.GetAudience(),
            &    ValidateIssuerSigningKey = true,
			&	IssuerSigningKeys = AuthenticationTools.GetJwks(),
			&	RequireExpirationTime = true,
			&	ValidateLifeTime = true,
			&	LifetimeValidator = new MyTokenValidationService(serviceProvider.GetRequiredService<IHttpContextAccessor>()).ValidateLifetime,
            &   RequireSignedTokens = true
            &    }

This is somewhat of a time critical request as we are trying to implement this before we go to production. I need assistance in implementing this properly so that the compiler will accept the changes. Can anyone help with this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions