3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
22 * An abstract representation of a signing token.
23 * Use in conjunction with @code SecurityTokenDecoder.
25 abstract class SecurityToken {
27 //FIXME Hmm seems php is refusing to let me make abstract static functions? odd
28 static public function createFromToken($token, $maxage) {}
30 static public function createFromValues($owner, $viewer, $app, $domain, $appUrl, $moduleId) {}
33 * Serializes the token into a string. This can be the exact same as
34 * toString; using a different name here is only to force interface
37 * @return A string representation of the token.
39 abstract public function toSerialForm();
42 * @return the owner from the token, or null if there is none.
44 abstract public function getOwnerId();
47 * @return the viewer from the token, or null if there is none.
49 abstract public function getViewerId();
52 * @return the application id from the token, or null if there is none.
54 abstract public function getAppId();
57 * @return the domain from the token, or null if there is none.
59 abstract public function getDomain();
62 * @return the URL of the application
64 abstract public function getAppUrl();
67 * @return the module ID of the application
69 abstract public function getModuleId();