Java Authenticator getRequestingSite() Method

The getRequestingSite() method of Authenticator class is used to get the InetAddress of the site requesting for the authorization, or null if not available.

Syntax:

Parameter:

No parameter is passed.

Return:

The InetAddress of the site requesting for authorization, or null if it's not available.

Throw:

Does not throw an Exception

Example 1

Test it Now

Output:

Port info ::-1
Site:null
//source code of https://www.javatpoint.com is printed. 

Example 2

Test it Now

Output:

Site info :null
Protocol:https
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
//Source code of https://www.javatpoint is printed. 





Latest Courses