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
23 * An abstract representation of a signing token.
24 * Use in conjunction with @code SecurityTokenDecoder.
26 abstract class SecurityToken
{
28 static public function createFromToken($token, $maxage) {}
30 static public function createFromValues($owner, $viewer, $app, $domain, $appUrl, $moduleId, $containerId) {}
33 * is this an anonymous token? Always check this before using the owner/viewer/etc
35 * @return boolean if it's anonymous
37 abstract public function isAnonymous();
40 * Serializes the token into a string. This can be the exact same as
41 * toString; using a different name here is only to force interface
44 * @return A string representation of the token.
46 abstract public function toSerialForm();
49 * @return the owner from the token, or null if there is none.
51 abstract public function getOwnerId();
54 * @return the viewer from the token, or null if there is none.
56 abstract public function getViewerId();
59 * @return the application id from the token, or null if there is none.
61 abstract public function getAppId();
64 * @return the domain from the token, or null if there is none.
66 abstract public function getDomain();
69 * @return the URL of the application
71 abstract public function getAppUrl();
74 * @return the module ID of the application
76 abstract public function getModuleId();
81 abstract public function getAuthenticationMode();
83 abstract public function setAuthenticationMode($mode);