All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.vk.api.sdk.actions.Auth Maven / Gradle / Ivy

Go to download

Java library for VK API interaction, includes OAuth 2.0 authorization and API methods.

The newest version!
package com.vk.api.sdk.actions;

import com.vk.api.sdk.client.AbstractAction;
import com.vk.api.sdk.client.VkApiClient;
import com.vk.api.sdk.client.actors.ServiceActor;
import com.vk.api.sdk.client.actors.UserActor;
import com.vk.api.sdk.queries.auth.AuthCheckPhoneQuery;
import com.vk.api.sdk.queries.auth.AuthRestoreQuery;

/**
 * List of Auth methods
 */
public class Auth extends AbstractAction {
    /**
     * Constructor
     *
     * @param client vk api client
     */
    public Auth(VkApiClient client) {
        super(client);
    }

    /**
     * Checks a user's phone number for correctness.
     *
     * @param actor vk actor
     * @param phone Phone number.
     * @param clientSecret
     * @return query
     */
    public AuthCheckPhoneQuery checkPhone(UserActor actor, String phone, String clientSecret) {
        return new AuthCheckPhoneQuery(getClient(), actor, phone, clientSecret);
    }

    /**
     * Checks a user's phone number for correctness.
     *
     * @param actor vk actor
     * @param phone Phone number.
     * @param clientSecret
     * @return query
     */
    public AuthCheckPhoneQuery checkPhone(ServiceActor actor, String phone, String clientSecret) {
        return new AuthCheckPhoneQuery(getClient(), actor, phone, clientSecret);
    }

    /**
     * Allows to restore account access using a code received via SMS. " This method is only available for apps with [vk.com/dev/auth_direct|Direct authorization] access. "
     *
     * @param actor vk actor
     * @param phone User phone number.
     * @param lastName User last name.
     * @return query
     */
    public AuthRestoreQuery restore(UserActor actor, String phone, String lastName) {
        return new AuthRestoreQuery(getClient(), actor, phone, lastName);
    }

    /**
     * Allows to restore account access using a code received via SMS. " This method is only available for apps with [vk.com/dev/auth_direct|Direct authorization] access. "
     *
     * @param actor vk actor
     * @param phone User phone number.
     * @param lastName User last name.
     * @return query
     */
    public AuthRestoreQuery restore(ServiceActor actor, String phone, String lastName) {
        return new AuthRestoreQuery(getClient(), actor, phone, lastName);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy