You've probably already heard that Today you can get information about almost any person through social networks
, and especially through VKontakte. Moreover, very often it is not at all necessary to be registered in it. It is enough to type the last name, first name and city of residence of the desired person in the search engine and that’s it.
I won’t go into detail about why this is bad (anyone who wants to can read the article I wrote on this subject about protecting a VKontakte account), but I’ll focus on how to make life even a little more difficult for curious people.
How to block your contact page from search engines? (Yandex, Google, etc.)
In the upper right corner click on the avatar. Select " Settings
».
Select the “ Privacy”
"
Scroll down to the “ Other
” block. Opposite the line “Who can see my page on the Internet” set the value “”.
If you have the old VKontakte design active
Go to the “ My Settings”
", the "
Privacy
" tab and opposite the very bottom line "Who can see my page on the Internet" set the value to "
Only VKontakte users
".
To check if you did everything correctly, do the following. Select “ My Page”
", then click on "
Log Out
".
After this, the following message should appear. « The page is available only to authorized users
».
How to make a VK page accessible only to authorized users?
In order to make the VKontakte page available only to authorized VK users, you need to go to the “Settings” section, then select the “Privacy” tab
Then scroll to the bottom of the page and in the item “Who can see my page on the Internet”, select from the drop-down menu the item “Only Vkontakte users”
This way, only authorized VKontakte users will be able to see your page.
To get started, go to your Page Settings, this option is located in the top right corner of your page. If you are using the electronic version, then you will see three dots there; if you are using a computer, you need to click on the checkmark on the right under the mini version of the avatar.
How to close your VKontakte page from other users?
You can close the entire page, or some part of it, from VKontakte participants in the same way - by going to the settings section, the “ Privacy”
" and setting the settings properly.
(Most often in the meaning “ Only me
”). Each item is described in detail, so you can figure out what is responsible for what.
The vast majority of sites are freely accessible and free for users. However, there are resources that offer additional information and subscription to paid services that require a procedure such as authorization. What does this give to users?
The user needs to fill out a form to create a domain with a personal login and password. A login is a unique name that is presented to a user on a given site. Typically, there cannot be two identical logins on one site. As for the password, it is a coded secret word or a certain sequence of characters. It confirms the fact that you are the owner of this login. For security purposes, when you enter your password, it is displayed with asterisks. There are sites that offer you to choose your own login and password, while others generate them yourself.
How to authorize using VKontakte in a desktop application
Share
This article uses a desktop application in Java as an example, but the general principles and scheme will be similar for any other language.
How does authorization occur?
Authorization on VKontakte is no different from any other authorization through a third-party server. This process was described perfectly by StackOverflow user qnub :
- On the service (in this case VK) you need to register the application and receive an API key.
- After this, the application (site) can request the user’s personal data from a third-party service through this same API, for which:
- redirect the user (user's browser by sending him a 302 Redirect HTTP response) via a specially generated link to a service providing an API;
- the user will perform some actions there, presumably log in and allow access to the data.
- Upon completion of the actions, the user will be redirected by a third-party service using the same 302 Redirect to the URL passed in the parameters of a specially generated link .
Step one. Register your application and get a key
This step is the easiest. You need to go to the VK page for developers: https://vk.com/dev - and click on the “Create an application” button. We indicate the type as “Standalone application”; the name, of course, is arbitrary. After that, your application will appear in the “My Applications” section (what do you think?) Feel free to click “edit”, then go to the “Settings” section - there in the first line you will see the inscription “Application ID: 1234567 ”. These numbers are all you need to remember to log in.
Note that there is no point in hiding the application ID - it is publicly displayed, for example, when posting a wall message through this application. Neither tokens nor any other information can be stolen using an ID. In fact, you can even use my application ID (if you need to write a small script for yourself).
Step two. Generating a special link
Next, you need to direct the user to a specially generated address (its mentions are highlighted in bold in the first section of the article), where he will confirm that he wants to allow your application to perform some actions with his account. How is this link formed?
This process is described in detail in the documentation. However, if you turned to this article, I assume that you did not have enough information in the documentation, and therefore I will retell everything in my own words. The link looks like this: host?parameters. The parameters take the form of several key=value pairs separated by & symbols.
The host always remains the same: https://oauth.vk.com/authorize. The set of parameters is also unchanged:
- client_id . Here it is worth indicating the same numbers that we obtained in the first step.
- redirect_uri . The address to which the user will be redirected. For Standalone applications this is only https://oauth.vk.com/blank.html.
- display . This parameter determines how the login page will be displayed. There are three options available: page, popup and mobile. If you're not sure, use page.
- scope . In this parameter, you should list the access parameters that you need, separated by commas. A complete list of available parameters is provided on the corresponding documentation page. Please note that you don’t have to specify anything at all and just don’t write this parameter. To find out what access options you need, look at the documentation of the methods you are going to use.
- response_type . We specify the token and move on.
- v . API version. Current – 5.59 .
An example of the link you should get:
https://oauth.vk.com/authorize?client_id=1&display=page&redirect_uri=https://example.com/callback&scope=friends&response_type=token&v=5.59
Step three. What's next?
Next, you should direct the user to the generated link. After he has completed all the necessary manipulations for authorization, he will be redirected to a page with the address
https://REDIRECT_URI#access_token=
TOKEN 3&expires_in= TIME &user_id= ID
We are interested in TOKEN . How to direct the user to a page from a Java application and how to get the address of the page to which VK will redirect him (in order to extract a token from it)? There are two ways.
Soviet, via default browser
If you decide to go this route, then you simply open the system's default browser with the link you received above, and somehow tell the user that he should copy the token from the URL and paste it into some field. Obviously, this method has terrible UX, but it can be implemented quickly and easily. It is quite suitable if you are writing an application for yourself - to download music or receive notifications. It is implemented as follows:
public String askToken(String link) throws IOException, URISyntaxException{ //Opens link in default browser Desktop.getDesktop().browse(new URI(link)); //Asks user to input token from browser manually return JOptionPane.showInputDialog("Please input access_token param from browser: "); }
Bourgeois, via web components
If you decide to go this route, you will need to use some third party GUI library (or at least JavaFX) that has its own browser component.
Your program will have full power over such a browser, and you will be able to retrieve the address to which VK redirected you using software. In JavaFX this can be implemented as follows: import javafx.application.Application; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.scene.Scene; import javafx.scene.web.WebEngine; import javafx.scene.web.WebView; import javafx.stage.Stage; public class Main extends Application{ public static final String REDIRECT_URL = "https://oauth.vk.com/blank.html"; public static final String VK_AUTH_URL = ""; //TODO!!! public static String tokenUrl; public static void main(String[] args){ System.out.println(Main.getTokenUrl()); } public static String getTokenUrl(){ launch(Main.class); return tokenUrl; } @Override public void start(Stage primaryStage) throws Exception { final WebView view = new WebView(); final WebEngine engine = view.getEngine(); engine.load(VK_AUTH_URL); primaryStage.setScene(new Scene(view)); primaryStage.show(); engine.locationProperty().addListener(new ChangeListener(){ @Override public void changed(ObservableValue
Authorization - what is it?
User authorization is a fundamental function on many websites. A typical Internet user encounters it regularly: on social networks, on forums, on news sites when leaving comments, on banking websites. As previously mentioned, when registering on the site, you can take advantage of the additional functions and capabilities provided. For example, in social networks it is an opportunity to see other profiles, communicate, download information, and in online stores it is possible to select and order any product.
What does it mean to log in to a website using Yandex as an example?
The concept of authorization is becoming more and more common in the modern world, so you need to know what it means to log in when a message appears that says “authorization required.”
Let's look at the authorization process in Yandex step by step:
- If you open the Yandex home page by default, then in the right corner click on the “Login to mail” button:
- If another search engine is open, then enter “Yandex mail” into the search and open the first link, this should be the official website. Or follow the link https://mail.yandex.ru/.
- In a special window, you will need to first enter your login and then your password. Enter your data if you are registered on the site. Next, click the login button. Authorization completed.
- If you are not registered, click on the registration button, fill out all the required fields, create a username and password, and remember them. The process of creating Yandex mail is described in detail at the link
- After successful registration, log in to the site as described in point 3.
After completing these five steps, you will be able to log in to Yandex.
You will need to do a similar procedure for entering your login and password on many sites where you want to perform an action, but cannot. The system will ask you to enter your login information. This process is requested on almost every website, forum, online stores, and social networks. This gives users some privileges, for example, authorized forum participants can leave their comments, and not just read the correspondence of other users, and after logging in to a social network, you can also view people’s profiles, add to your friends list, subscribe, and write messages.
In online stores, only authorized users can place an order, because during registration they indicate their contact information and address.
Now you know what authorization on the site is, so don’t be alarmed when the system asks you to log in, this is the normal procedure for logging into your account.
Why is user registration needed?
As you understand, identification helps to identify a site visitor, as well as to impose restrictions on its capabilities and resources for other users.
The question arises: authorization - what is it and why limit access using it? After all, it would be much easier to provide the site's capabilities to all users. Moreover, the registration procedure sometimes takes quite a bit of time. But there is one good reason why owners introduce authorization. The fact is that it helps to limit visitors and the site itself from spam. Another important purpose of authorization is identification.
This information is transmitted voluntarily and is used solely for the purpose of recognition by other visitors.
Naturally, registration has many other tasks and functions, but these two are the most important.
Main advantages of identification
Both site owners and its users have benefits. The advantages for the owner are:
- Anti-spam protection (screening out spam bots).
- Restriction of rights to use additional services. For commercial sites, authorization is simply necessary, since they provide their services for money.
- The ability to get to know the user, which also has its advantages: geographic, demographic and other information about visitors, which allows you to set up the site correctly, select the most effective advertising and keywords.
Benefits for users:
- Also anti-spam protection.
- Ability to recognize your interlocutor.
- Additional features such as filling out a profile, uploading a photo, other files, and so on.
So, we figured out what authorization is. That this is a means of protecting user data. For websites it is of great importance. Based on this, you should take the situation seriously if your authorization fails.
Go to the VKontakte website https://vk.com/. In the address bar (at the top of the window) put “/” and write search. Press Enter.
Step 2
A search window will open. In the line, enter the first and last name of the person whose page you are looking for. If there are many people with the same name, fill out the advanced search form on the right.
Step 3
You go to the page and look at it. What to do if “The page is available only to authorized users.”? There is a solution! Do you know who has this person as a friend? If so, find a “middleman.” For example, you searched for Vasya Pupkin, and his “Page is available only to authorized users.” Vasya is a friend of Ololoshi Ololoev. So, look for this Ololosha Ololoev.
Step 4
Once you find him, look at his friends list. Have you found the person you need? Hover over his photo and click “Enlarge”. Below the photo you will see this (look at the picture). Click on “Photos from Page...”. A window will open with all the photo albums of the person you need.
Viewing a VK page from the side
Next, we will tell you how to see your VKontakte page from the outside. You can check it out yourself, or you can involve one of your friends. The main thing is that this friend is kind and sympathetic, so make sure of this first.
Method 1. Privacy settings
There is a section in VK where we customize the appearance of the wall, determine what information guests see, and so on. This section is called "Privacy Settings". It will help us look at ourselves through the eyes of other users.
You need to do the following:
- Log in to your VK account.
- At the top right you see your name and mini-avatar - click on it.
- A drop-down menu will appear where you need to select “Settings”.
- You will find yourself on the corresponding page. In the block on the right, select “Privacy”.
- Scroll to the bottom of this section.
- Here you will see a blue line, by clicking on which you can see your VKontakte page from the outside.
Keep in mind that these instructions are only suitable for the full version of VK; this option is not available for mobile. That is, you need to log into the social network using a computer. Unfortunately, you won’t be able to find out in this way how other users see your account on your phone.
Method 2. Find yourself
We continue to look for answers to the question “How to see what my VKontakte page looks like.” Another option is to use the browser you usually use. We do the following:
- Sign in to your account.
- Click on the inscription “My Page” in the block on the left.
- Copy the address from the browser bar.
- Now click on your name in the upper right corner.
- Select "Exit" from the drop-down menu.
- Open a new browser tab.
- Paste the previously copied link into the address bar.
- Press Enter.
You can find yourself this way without copying the address from the browser line. It will be enough to enter your first and last name and the word “VKontakte”. However, then the search engine will also show you the accounts of other users, your namesakes. Search in this case will be difficult. Although you can admire your namesakes.
This method doesn't always work. Check your privacy settings. If it is determined that only VK users can see you, then nothing will work. In this case, the search engine will show you an empty account with your name. The avatar will feature a mysterious dog. And the warning will read “The page is available only to authorized users.”
Method 3. Left page
This path is longer and less exciting, but many people prefer it. True, they use it not just as a way to view their VK page from the outside, but also for other purposes.
We are talking about registering another account:
- Open the website vk.com or exit your page.
- On the right you see a window for quick registration.
- Enter your first name, last name and date of birth in the appropriate fields.
- Click “Continue registration”.
In principle, you can stop at this stage, since a new account has already been created. Or you can go further and create a full-fledged page, following the system prompts.
Now you can go to your old page and see all the information on it through the eyes of another user. In this case, the question “What does my VK page look like from the outside?” will disappear by itself.