강의

멘토링

커뮤니티

인프런 커뮤니티 질문&답변

유신일님의 프로필 이미지
유신일

작성한 질문수

스프링 시큐리티

로그인 한 사용자 마다 다른 객체를 사용하게 할 수 있는 방법이 있는지 알고 싶습니다.

작성

·

176

0

안녕하세요

로그인 한 사용자 마다 다른 객체를 사용하게 할 수 있는 방법이 있는지 알고 싶습니다.

예를들어 아래와 같은 소스가 있으면

JsonBimServerClientFactory factory = new JsonBimServerClientFactory(bimserverAddress);
BimServerClient bimServerClient = factory.create(new UsernamePasswordAuthenticationInfo(username, password));

매번 factory.create(new UsernamePasswordAuthenticationInfo(username, password)) 메소드를 호출해서 BimServerClient 객체를 가지고 오는데 로그인 한 사용자마다 각자 자신에 username 과 password로 생성된 BimServerClient 객체를 사용할 수 있는 방법이 있을까요?

답변 1

0

백기선님의 프로필 이미지
백기선
지식공유자

인증된 사용자마다 SecurityContext에 각기 다른 Authentication 객체가 만들어 지는걸 생각하시면 그런 로직을 응용해서 원하시는 객체도 비슷하게 만들 수 있지 않을까 싶네요.

유신일님의 프로필 이미지
유신일

작성한 질문수

질문하기