2 * Copyright (c) 2014, 2015 Hewlett-Packard Development Company, L.P. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.aaa.keystone;
11 import java.util.List;
13 import org.opendaylight.aaa.api.Authentication;
14 import org.opendaylight.aaa.api.TokenAuth;
15 import org.slf4j.Logger;
16 import org.slf4j.LoggerFactory;
19 * A Keystone {@link TokenAuth} filter.
23 public class KeystoneTokenAuth implements TokenAuth {
24 private static final Logger LOG = LoggerFactory.getLogger(KeystoneTokenAuth.class);
26 static final String TOKEN = "X-Auth-Token";
29 public Authentication validate(Map<String, List<String>> headers) {
30 if (!headers.containsKey(TOKEN)) {
31 return null; // Not a Keystone token
34 // TODO: Call into Keystone to get security context...
35 LOG.info("Not yet validating token {}", headers.get(TOKEN).get(0));