Java Authenticator getRequestingURL() Method

20 Mar 2025 | 2 min read

The getRequestingURL() method of Authenticator class returns the URL that resulted in this request for authentication.

Syntax:

Parameter:

No parameter is passed.

Return:

the requesting URL

Throw:

Does not throw the exception.

Example 1

Output:

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

Example 2

Output:

 URL info :null Protocol:https //source code of https://www.tpointtech.com is printed.