Johnny
Johnny
Explore posts from servers
WWasp-lang
Created by Johnny on 4/2/2024 in #🙋questions
Password Reset token invalidation
Hey, could it be that a password token can be reused once it is used? Tried it 3 times with the same token and it changed every time the password
22 replies
WWasp-lang
Created by Johnny on 4/2/2024 in #🙋questions
Mails not being sent (Mailgun and Sendgrid tested => both haven't even got an API request)
Hey, I have setup my main.wasp with my email I have registered and set the APIKey - for password reset I am getting 200 as return but no mail is ever being sent
26 replies
CC#
Created by Johnny on 3/13/2024 in #help
JWT refreshing + validatin/invalidating infinite error throwing
Hey, I have implemented a JWT refresh method (worked ast some point and then I tried adding invalidation - now it reruns indefinitely with error throwing all the time) RefreshTokenAndJWT() is being called - Anyone an idea where the logic issue is? if (!await ValidateAndInvalidateRefreshToken(refreshToken)) { throw new InvalidOperationException("Invalid refresh token."); } is being spammed
1 replies
CC#
Created by Johnny on 8/29/2023 in #help
❔ Hellang ProblemDetails with AWS - returnung AWS exception/ AWS Exception handling
Hey, having some issues with Hellang ProblemDetails and AWS Cognito authentication -
internal static class Startup
{
internal static IServiceCollection ExceptionInjections(this IServiceCollection services)
{
services.AddProblemDetails(setup =>
{
setup.IncludeExceptionDetails = (ctx, ex) =>
{
return false;
};
setup.MapToStatusCode<ValidationException>(400);
setup.MapToStatusCode<NotImplementedException>(501);
setup.MapToStatusCode<UserNotFoundException>(404);
setup.MapToStatusCode<UsernameExistsException>(409);
setup.MapToStatusCode<NotAuthorizedException>(400);
setup.MapToStatusCode<InvalidParameterException>(400);
setup.MapToStatusCode<InvalidLambdaResponseException>(400);
...

});
return services;
}
}
internal static class Startup
{
internal static IServiceCollection ExceptionInjections(this IServiceCollection services)
{
services.AddProblemDetails(setup =>
{
setup.IncludeExceptionDetails = (ctx, ex) =>
{
return false;
};
setup.MapToStatusCode<ValidationException>(400);
setup.MapToStatusCode<NotImplementedException>(501);
setup.MapToStatusCode<UserNotFoundException>(404);
setup.MapToStatusCode<UsernameExistsException>(409);
setup.MapToStatusCode<NotAuthorizedException>(400);
setup.MapToStatusCode<InvalidParameterException>(400);
setup.MapToStatusCode<InvalidLambdaResponseException>(400);
...

});
return services;
}
}
am I using to not show errors but for some reason they always appear:
Error: response status is 500

Response body
Download
Amazon.CognitoIdentityProvider.Model.UserNotFoundException: User does not exist.
---> Amazon.Runtime.Internal.HttpErrorResponseException: Exception of type 'Amazon.Runtime.Internal.HttpErrorResponseException' was thrown.
at Amazon.Runtime.HttpWebRequestMessage.GetResponseAsync(CancellationToken cancellationToken)
....
--- End of inner exception stack trace ---
at Amazon.Runtime.Internal.HttpErrorResponseExceptionHandler.HandleExceptionStream(IRequestContext requestContext, IWebResponseData httpErrorResponse, HttpErrorResponseException exception, Stream responseStream)
....
Error: response status is 500

Response body
Download
Amazon.CognitoIdentityProvider.Model.UserNotFoundException: User does not exist.
---> Amazon.Runtime.Internal.HttpErrorResponseException: Exception of type 'Amazon.Runtime.Internal.HttpErrorResponseException' was thrown.
at Amazon.Runtime.HttpWebRequestMessage.GetResponseAsync(CancellationToken cancellationToken)
....
--- End of inner exception stack trace ---
at Amazon.Runtime.Internal.HttpErrorResponseExceptionHandler.HandleExceptionStream(IRequestContext requestContext, IWebResponseData httpErrorResponse, HttpErrorResponseException exception, Stream responseStream)
....
2 replies
CC#
Created by Johnny on 1/28/2023 in #help
❔ Creating my first "bigger" Web Application with .net core (6.0) - project structure
Hey, I am currently having some struggle with defining a way of developing my Application -> It is planned to have User/Companies, Company accounts with users etc. My idea was to go with 1 Web Api project and multiple Class librarys but I am not sure if this is the best way. I created an Auth WebAPI solution for now and want to create a UserManagement solution now. They should use two different databases and more solutions will be added. I had the idea to maybe create multiple Web API projects and use just 1 static swagger instance - would this work/be useful? What are your thoughts/ideas
2 replies
CC#
Created by Johnny on 1/27/2023 in #help
❔ .net Identity 401 => Roles/Claims available
Hey, I keep getting 401 with the following bearer in Swagger (authorized)
Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoic3RyaW5nIiwianRpIjoiZDgxZTYzN2YtN2YyOS00YTJlLWFkMGQtMzUyYTNmMmM1MmNiIiwidXNlciI6WyJyZWFkIiwid3JpdGUiXSwiaHR0cDovL3NjaGVtYXMubWljcm9zb2Z0LmNvbS93cy8yMDA4LzA2L2lkZW50aXR5L2NsYWltcy9yb2xlIjpbIkFkbWluIiwiVXNlciJdLCJleHAiOjE2NzQ4MTc5OTYsImlzcyI6Imh0dHA6Ly9sb2NhbGhvc3Q6MjQ5NC8iLCJhdWQiOiJodHRwOi8vbG9jYWxob3N0OjI0OTQvIn0.3Z-DOjNZpucRtz0VbfJtAPZkKtFYkRrsJIpkeMcc6fI
Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoic3RyaW5nIiwianRpIjoiZDgxZTYzN2YtN2YyOS00YTJlLWFkMGQtMzUyYTNmMmM1MmNiIiwidXNlciI6WyJyZWFkIiwid3JpdGUiXSwiaHR0cDovL3NjaGVtYXMubWljcm9zb2Z0LmNvbS93cy8yMDA4LzA2L2lkZW50aXR5L2NsYWltcy9yb2xlIjpbIkFkbWluIiwiVXNlciJdLCJleHAiOjE2NzQ4MTc5OTYsImlzcyI6Imh0dHA6Ly9sb2NhbGhvc3Q6MjQ5NC8iLCJhdWQiOiJodHRwOi8vbG9jYWxob3N0OjI0OTQvIn0.3Z-DOjNZpucRtz0VbfJtAPZkKtFYkRrsJIpkeMcc6fI
I have created a controller for the role "Admin" and a controller for the policy "user.read" but both return me 401. Anyone an idea what the problem might be? I am using a custom policy "creator" that is creating a policy in the format "user.read" => user = ClaimType/read = ClaimValue
36 replies
CC#
Created by Johnny on 12/6/2022 in #help
❔ How to remove auto startup of angular project from visual studio
Description is the heading.
2 replies
CC#
Created by Johnny on 9/8/2022 in #help
Convert Object to IFropmFile
Hey, how can I convert a json object ( with sum objects etc.) to IFromFile?
1 replies
CC#
Created by Johnny on 8/31/2022 in #help
Linq Where JsonSerialization not working
Hey, is there a way to get the following running:
dbSet.Set<Table>().Where(x => JsonSerializer.Deserialize<Object>(x.Value).Number1 == localGivenNumber).ToList();
dbSet.Set<Table>().Where(x => JsonSerializer.Deserialize<Object>(x.Value).Number1 == localGivenNumber).ToList();
I am getting the error an expression tree cannot contain a call or invocation that uses optional arguments
10 replies