質問編集履歴

1

補足の追記

2017/08/28 15:29

投稿

iride
iride

スコア18

test CHANGED
File without changes
test CHANGED
@@ -97,3 +97,35 @@
97
97
  アドバイス等を頂ければ幸いです。
98
98
 
99
99
  よろしくお願いします。
100
+
101
+
102
+
103
+ ###[追記]
104
+
105
+ 実現したい内容について、
106
+
107
+ 補足いたします。
108
+
109
+
110
+
111
+ BasicAuthenticationFilterクラス内の
112
+
113
+ doFilterInternal()メソッドでの
114
+
115
+ SecurityContextHolder.getContext().setAuthentication(authResult);
116
+
117
+ によってRoleを付与しているのだと思いますが、
118
+
119
+ 今回は、**認証時にRoleの情報は変更せず**、Sessionに付与するように変更をしたい。
120
+
121
+
122
+
123
+ HttpBasicConfigurerクラスに手を加えることも考えましたが
124
+
125
+ configure()メソッドで、BasicAuthenticationFilterを
126
+
127
+ newしているため、変更はできそうにありませんでしたし、
128
+
129
+ HttpBasicConfigurerクラスは継承不可なので、
130
+
131
+ オーバーライドもできないため、無理だと判断しました。