class OAuth10ProfileCreator extends OAuthProfileCreator {

    /**
     * <p>Constructor for OAuth10ProfileCreator.</p>
     *
     * @param configuration a {@link OAuth10Configuration} object
     * @param client a {@link IndirectClient} object
     */
    public OAuth10ProfileCreator(final OAuth10Configuration configuration, final IndirectClient client) {
        super(configuration, client);
    }

    /** {@inheritDoc} */
    @Override
    protected OAuth1AccessToken getAccessToken(final Credentials credentials) {<FILL_FUNCTION_BODY>}

    /** {@inheritDoc} */
    @Override
    protected void addTokenToProfile(final UserProfile userProfile, final Token tok) {
        val profile = (OAuth10Profile) userProfile;
        val accessToken = (OAuth1AccessToken) tok;
        if (profile != null) {
            val token = accessToken.getToken();
            logger.debug("add access_token: {} to profile", token);
            profile.setAccessToken(token);
            profile.setAccessSecret(accessToken.getTokenSecret());
        }
    }

    /** {@inheritDoc} */
    @Override
    protected void signRequest(final OAuthService service, final Token tok, final OAuthRequest request) {
        val token = (OAuth1AccessToken) tok;
        ((OAuth10aService) service).signRequest(token, request);
        if (this.configuration.isTokenAsHeader()) {
            request.addHeader("Authorization", "Bearer " + token.getToken());
        }
    }
}

        // we assume the access token only has been passed: it can be a bearer call (HTTP client)
        if (credentials instanceof TokenCredentials) {
            val accessToken = ((TokenCredentials) credentials).getToken();
            return new OAuth1AccessToken(accessToken, null);
        }
        // regular OAuth flow
        return ((OAuth10Credentials) credentials).getAccessToken();
    
<methods>public Optional<org.pac4j.core.profile.UserProfile> create(CallContext, org.pac4j.core.credentials.Credentials) <variables>protected org.pac4j.core.client.IndirectClient client,protected org.pac4j.oauth.config.OAuthConfiguration configuration,protected final org.slf4j.Logger logger,protected static final non-sealed com.fasterxml.jackson.databind.ObjectMapper mapper