Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3806924
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T14:54:37+00:00 2026-05-19T14:54:37+00:00

What I am trying to do : I am trying to connect to Web

  • 0

What I am trying to do :

I am trying to connect to Web Portal [that uses https]using Java.
I have written code for supplying user credentials using Authenticator class.When I run the program I get an Exception:

“java.lang.UnsupportedOperationException: Not supported yet”

I have the code posted :

public class Main {

    public class MyAuthenticator extends Authenticator {

        protected PasswordAuthentication getpasswordAuthentication() {
            String username = "username";
            String password = "password";
            // Return the information
            return new PasswordAuthentication(username, password.toCharArray());
        }

        @Override
        public Result authenticate(HttpExchange he) {
            throw new UnsupportedOperationException("Not supported yet.");
        }
    }

    public static void main(String[] args) {
        // TODO code application logic here


        TrustManager[] trustClients = new TrustManager[]{
            new X509TrustManager() {

                public void checkClientTrusted(X509Certificate[] xcs, String string) throws CertificateException {
                    throw new UnsupportedOperationException("Not supported yet.");
                }

                public void checkServerTrusted(X509Certificate[] xcs, String string) throws CertificateException {

                    throw new UnsupportedOperationException("Not supported yet.");
                }

                public X509Certificate[] getAcceptedIssuers() {
                    return null;
                    //throw new UnsupportedOperationException("Not supported yet.");
                }
            }
        };
        try {
            SSLContext sslcontext = SSLContext.getInstance("SSL");
            sslcontext.init(null, trustClients, new java.security.SecureRandom());
            HttpsURLConnection.setDefaultSSLSocketFactory(sslcontext.getSocketFactory());

        } catch (Exception e) {
            System.out.println("in 1st catch " + e);
        }


        try {
            URL url = new URL("https://someURL.server.com/fmk/jsp/ltpaLogin.jsp");
            URLConnection urlconnection = url.openConnection();
            System.out.println(urlconnection);
            System.out.print(urlconnection.getInputStream().toString());



} catch (Exception e) {
            System.out.println("in 2ndcatch " + e.getMessage());
        }
    }
}

the exception “java.lang.UnsupportedOperationException: Not supported yet”is raised in the 2nd Try.Is my approach correct ? if not is there any alternative to do so ?

When I open the page in web browser I get the login page;Once I supply my credentials the web portal is displayed

Can any one please suggest how to hit the webportal and supply my credentials and check the authentication is success or not ?
Any sample code snippets will be really helpful
Thanks in advance..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T14:54:38+00:00Added an answer on May 19, 2026 at 2:54 pm

    Have you seen this code fragment ?

        @Override
        public Result authenticate(HttpExchange he) {
            throw new UnsupportedOperationException("Not supported yet.");
        }
    

    It’s precisely the one that will throw the aforementionned exception each time you try to authenticate.

    So, to my mind, the solution to your authentication problem is quite simple : implement this method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to connect to a web service that uses a secure connection.
I'm trying to connect to a web service using IO::Socket::INET (yes, I know that
I have been trying to connect to some web services using WCF but I
I'm trying to connect to a web service, written in Java, but there's something
i am new to web programming. i am trying to connect database using jsp
I have been trying to connect to my database using pdo on godaddy with
I'm trying to connect to a MySQL database using my ASP.NET Web Forms Application.
I have a Dynamic Web Project in Eclipse and is trying to connect through
I'm trying to connect from a web app to another web app using the
I'm using HostMonster as my web host and I'm trying connect to a database

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.