Subversion Repositories eFlore/Applications.cel

Rev

Rev 2846 | Rev 3027 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2846 Rev 3024
Line 138... Line 138...
138
		return ($retour === true);
138
		return ($retour === true);
139
	}
139
	}
Line 140... Line 140...
140
	
140
	
141
	private function decoderToken($token) {
141
	private function decoderToken($token) {
142
		$token_parts = explode('.', $token);
142
		$token_parts = explode('.', $token);
-
 
143
		return json_decode($this->urlsafeB64Decode($token_parts[1]), true);
-
 
144
	}
-
 
145
 
-
 
146
	/**
-
 
147
	 * Decode a string with URL-safe Base64.
-
 
148
	 * copiƩ depuis firebase/jwt
-
 
149
	 *
-
 
150
	 * @param string $input A Base64 encoded string
-
 
151
	 * @return string A decoded string
-
 
152
	 */
-
 
153
	protected function urlsafeB64Decode($input)	{
-
 
154
		$remainder = strlen($input) % 4;
-
 
155
		if ($remainder) {
-
 
156
			$padlen = 4 - $remainder;
-
 
157
			$input .= str_repeat('=', $padlen);
-
 
158
		}
143
		return json_decode(base64_decode($token_parts[1]), true);
159
		return base64_decode(strtr($input, '-_', '+/'));
Line 144... Line 160...
144
	}
160
	}
145
	
161
	
146
	private function obtenirLoginParToken($token) {
162
	private function obtenirLoginParToken($token) {
Line 214... Line 230...
214
			}
230
			}
215
		}
231
		}
216
		return $headers;
232
		return $headers;
217
	}
233
	}
218
}
234
}
219
?>
-
 
220
235
?>
-
 
236