ODLPrincipal extends Principal 62/101162/1
authorPeter Puškár <ppuskar@frinx.io>
Tue, 17 May 2022 12:08:37 +0000 (14:08 +0200)
committerRobert Varga <nite@hq.sk>
Sat, 28 May 2022 18:23:17 +0000 (18:23 +0000)
commit6457b2ebc1d3ab8e1e6ba4b11f76623ecad07a17
treeaf9517c5a953a631420cb3096f2db698bcaa0024
parent48e5bb8bc9d9cbdc0149cf6d8f6efa4a77e28379
ODLPrincipal extends Principal

JAX-RS SecurityContext returns ODLPrincipal when method getPrincipal() is called on SecurityContext.
Method getPrincipal() is returning object of type Principal.
Now we currently cannot cast this object to ODLPrincipal as ClassCastException is thrown,
that makes this completely unusable when using SecurityContext.
Principal.getName() is not providing enough information as it just returns toString() by default.

Signed-off-by: Peter Puškár <ppuskar@frinx.io>
Change-Id: Id17d3b6859732a61de9be48a7b46775c13de6f27
(cherry picked from commit 671e909aed32e3522139e98c0a73e850e0717a7b)
aaa-shiro/api/src/main/java/org/opendaylight/aaa/api/shiro/principal/ODLPrincipal.java
aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/principal/ODLPrincipalImpl.java