com.nimbusds.openid.connect.provider.spi.grants.DefaultTokenRequestParameters Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of c2id-server-sdk Show documentation
Show all versions of c2id-server-sdk Show documentation
SDK for Connect2id Server extensions, such as OpenID Connect claims
sources and OAuth 2.0 grant handlers
package com.nimbusds.openid.connect.provider.spi.grants;
import java.net.URI;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import org.checkerframework.checker.nullness.qual.Nullable;
import com.nimbusds.oauth2.sdk.Scope;
/**
* Default token request parameters implementation.
*/
public class DefaultTokenRequestParameters implements TokenRequestParameters{
/**
* The requested scope.
*/
private final @Nullable Scope scope;
/**
* The requested resource server URI(s).
*/
private final @Nullable List resources;
/**
* Custom token request parameters.
*/
private final Map> customParams;
/**
* Creates a new token request parameters instance.
*
* @param scope The requested scope, {@code null} if not specified.
*/
public DefaultTokenRequestParameters(final @Nullable Scope scope) {
this(scope, null, Collections.emptyMap());
}
/**
* Creates a new token request parameters instance.
*
* @param scope The requested scope, {@code null} if not
* specified.
* @param resources The requested resource server URI(s),
* {@code null} if not specified.
* @param customParams Custom parameters, empty map if none.
*/
public DefaultTokenRequestParameters(final @Nullable Scope scope,
final @Nullable List resources,
final Map> customParams) {
this.scope = scope;
this.resources = resources;
Objects.requireNonNull(customParams);
this.customParams = customParams;
}
@Override
public @Nullable Scope getScope() {
return scope;
}
@Override
public @Nullable List getResources() {
return resources;
}
@Override
public Map> getCustomParameters() {
return customParams;
}
}