001/*
002 * (C) Copyright 2017 Nuxeo (http://nuxeo.com/) and others.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 *
016 * Contributors:
017 *     Thomas Roger
018 *
019 */
020
021package org.nuxeo.ecm.platform.oauth2;
022
023import java.util.Arrays;
024import java.util.List;
025
026/**
027 * @since 9.2
028 */
029public final class Constants {
030
031    private Constants() {
032        // constants class
033    }
034
035    public static final String TOKEN_SERVICE = "org.nuxeo.server.token.store";
036
037    public static final String RESPONSE_TYPE_PARAM = "response_type";
038
039    public static final String CODE_RESPONSE_TYPE = "code";
040
041    public static final String SCOPE_PARAM = "scope";
042
043    public static final String STATE_PARAM = "state";
044
045    public static final String CLIENT_ID_PARAM = "client_id";
046
047    public static final String CLIENT_SECRET_PARAM = "client_secret";
048
049    public static final String REDIRECT_URI_PARAM = "redirect_uri";
050
051    public static final String REDIRECT_URL_PARAM = "redirect_url";
052
053    public static final String AUTHORIZATION_CODE_PARAM = "code";
054
055    public static final String REFRESH_TOKEN_PARAM = "refresh_token";
056
057    public static final String GRANT_TYPE_PARAM = "grant_type";
058
059    /** @since 11.1 */
060    public static final String ASSERTION_PARAM = "assertion";
061
062    public static final String AUTHORIZATION_CODE_GRANT_TYPE = "authorization_code";
063
064    public static final String REFRESH_TOKEN_GRANT_TYPE = "refresh_token";
065
066    /** @since 11.1 */
067    public static final String JWT_BEARER_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:jwt-bearer";
068
069    /** --------------------------- PKCE --------------------------- */
070    public static final String CODE_CHALLENGE_PARAM = "code_challenge";
071
072    public static final String CODE_CHALLENGE_METHOD_PARAM = "code_challenge_method";
073
074    public static final String CODE_VERIFIER_PARAM = "code_verifier";
075
076    public static final String CODE_CHALLENGE_METHOD_PLAIN = "plain";
077
078    public static final String CODE_CHALLENGE_METHOD_S256 = "S256";
079
080    public static final List<String> CODE_CHALLENGE_METHODS_SUPPORTED = Arrays.asList(CODE_CHALLENGE_METHOD_PLAIN,
081            CODE_CHALLENGE_METHOD_S256);
082
083}