001/*
002 * Copyright 2016 The AppAuth for Android Authors. All Rights Reserved.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
005 * in compliance with the License. You may obtain a copy of the License at
006 *
007 * http://www.apache.org/licenses/LICENSE-2.0
008 *
009 * Unless required by applicable law or agreed to in writing, software distributed under the
010 * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
011 * express or implied. See the License for the specific language governing permissions and
012 * limitations under the License.
013 */
014
015package net.openid.appauth;
016
017/**
018 * The grant type values defined by the [OAuth2 spec](https://tools.ietf.org/html/rfc6749), and
019 * used in {@link AuthorizationRequest authorization} and
020 * {@link RegistrationRequest dynamic client registration} requests.
021 */
022public final class GrantTypeValues {
023    /**
024     * The grant type used for exchanging an authorization code for one or more tokens.
025     *
026     * @see "The OAuth 2.0 Authorization Framework (RFC 6749), Section 4.1.3
027     * <https://tools.ietf.org/html/rfc6749#section-4.1.3>"
028     */
029    public static final String AUTHORIZATION_CODE = "authorization_code";
030
031    /**
032     * The grant type used when obtaining an access token.
033     *
034     * @see "The OAuth 2.0 Authorization Framework (RFC 6749), Section 4.2
035     * <https://tools.ietf.org/html/rfc6749#section-4.2>"
036     */
037    public static final String IMPLICIT = "implicit";
038
039    /**
040     * The grant type used when exchanging a refresh token for a new token.
041     *
042     * @see "The OAuth 2.0 Authorization Framework (RFC 6749), Section 6
043     * <https://tools.ietf.org/html/rfc6749#section-6>"
044     */
045    public static final String REFRESH_TOKEN = "refresh_token";
046
047    private GrantTypeValues() {
048        throw new IllegalStateException("This type is not intended to be instantiated");
049    }
050}