lucifer7303
JCHJava Community | Help. Code. Learn.
•Created by lucifer7303 on 10/24/2024 in #java-help
Custom Method to get Token to be provided with OpenFeign proxy requests
So i was making an app which calls a third party API and it requires a auth token with it.
I thoight itd be pretty easy to make a RequestInterceptor and make Spring Security do it for me
But the endpoint which gives the token has 2 problems. It uses password grant type and it has 2 extra fields "username" and "password" required along eith client id and client secret
The ClientRegistration class is final and has no way of making custom implementation
So how do i handle getting this token and providing it to OpenFeign when it makes the call
TLDR:Problem handling password grant type and added attributes to ClientRegistration, for a client implementaion
7 replies
JCHJava Community | Help. Code. Learn.
•Created by lucifer7303 on 9/27/2024 in #java-help
Spring Security and OAuth 2 learning difficulties
so i was going through Spring Security in Action by Laurentiu Spilca and read it till ch 11 so i understand the architecture and flow of spring security
but when i came to oauth 2 part it confused me a lot and even made me doubt if i understood the previous part
can yall recommend me a oauth 2 tutorial article/video or wtv that can clear it up for me
the book just isnt doing it for me and his playlist too couldnt clear it up
8 replies
JCHJava Community | Help. Code. Learn.
•Created by lucifer7303 on 6/18/2024 in #java-help
Spiring bean scope related query
okay so i was just making a mini project where the first page is a login page and when you login successfully youll get a page where you can add items to your cart and also option to display your cart
i made a session mapped LoginService class which has a private User attribute
so whenever there was a succesful login i was assigning the user attribute of LoginService an object(the first function)
and whenever an item was to be added i was adding it to the user attribute of LoginService bean(second method)
but different LoginService beans are injected into the first and second method. Why is that so. isnt LoginService SessionMapped??
52 replies
JCHJava Community | Help. Code. Learn.
•Created by lucifer7303 on 6/12/2024 in #java-help
Java Spring Help regarding @AutoWired
19 replies
JCHJava Community | Help. Code. Learn.
•Created by lucifer7303 on 4/19/2024 in #java-help
Cannot understand this behaviour of java when adding a list to a list of lists.
https://leetcode.com/problems/subsets/submissions/1236349921
this is the leetcode ques i was solving
as you can see the ans list which is supposed to be a subset of the set is being formed and is printed in the stdout just before it was added to the fin global string which is ultimately returned as the answer.
on further debugging its adding the current string n number of times where n is the array index of the power set array
so in the last iteration its adding a null set n(8) times.
But when i pass a clone of the list in function call, the program works as intended
Any explanation?
122 replies