Add explicit storage for authentication methods 69/99569/2
authorShibu Vijayakumar <shibu.vijayakumar@infosys.com>
Thu, 3 Feb 2022 13:38:02 +0000 (13:38 +0000)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 8 Feb 2022 09:20:43 +0000 (10:20 +0100)
We seem to need an explicit field for methods, add it.

JIRA: AAA-220
Change-Id: I503f0118370eea6e6ba4ff6909c652314c2ca8b3
Signed-off-by: Shibu Vijayakumar <shibu.vijayakumar@infosys.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/keystone/domain/KeystoneAuth.java

index 1eef9e2fc5b76912401754344f8a35ffd880bc59..6830ab2fcc2d2125e7cb488fe9116b059ac8c56d 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.aaa.shiro.keystone.domain;
 
 /**
@@ -42,14 +41,16 @@ public class KeystoneAuth {
         public static final class Identity {
             private static final String METHOD_PASSWORD = "password";
 
+            private final String[] methods;
             private final Password password;
 
             private Identity(String username, String password, String domain) {
                 this.password = new Password(username, password, domain);
+                this.methods = new String[]{ METHOD_PASSWORD };
             }
 
             public String[] getMethods() {
-                return new String[]{METHOD_PASSWORD};
+                return methods == null ? null : methods.clone();
             }
 
             public Password getPassword() {