<commit_before>package edu.iu.grid.oim.servlet;

////////////////////////////////
import edu.iu.grid.oim.lib.StaticConfig;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.DataOutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;
import org.json.*;
import javax.servlet.http.HttpSession;

import net.minidev.json.JSONObject;
import net.minidev.json.JSONValue;
import net.minidev.json.JSONArray;
import net.minidev.json.JSONStyle;
import net.minidev.json.parser.ParseException;

import java.io.UnsupportedEncodingException;
import java.util.*;

////////////////////////////////

import java.io.IOException;
import java.io.PrintWriter;
import java.sql.SQLException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
import com.divrep.DivRep;
import com.divrep.DivRepEvent;

import edu.iu.grid.oim.lib.Authorization;
import edu.iu.grid.oim.model.UserContext;
import edu.iu.grid.oim.model.db.ContactModel;
import edu.iu.grid.oim.model.db.record.ContactRecord;
import edu.iu.grid.oim.view.BootMenuView;
import edu.iu.grid.oim.view.BootPage;
import edu.iu.grid.oim.view.ContactAssociationView;
import edu.iu.grid.oim.view.GenericView;
import edu.iu.grid.oim.view.HtmlView;
import edu.iu.grid.oim.view.IView;
import edu.iu.grid.oim.view.LinkView;
import edu.iu.grid.oim.view.SideContentView;

///////////////////////
import java.net.URI;
import java.net.URL;

import com.nimbusds.oauth2.sdk.client.*;
import com.nimbusds.oauth2.sdk.token.*;
import com.nimbusds.oauth2.sdk.util.*;
import com.nimbusds.oauth2.sdk.id.*;
import com.nimbusds.oauth2.sdk.auth.*;
import com.nimbusds.oauth2.sdk.http.*;
import com.nimbusds.oauth2.sdk.*;

import com.nimbusds.openid.connect.sdk.*;
import com.nimbusds.openid.connect.sdk.claims.*;
import com.nimbusds.openid.connect.sdk.id.*;
import com.nimbusds.openid.connect.sdk.op.*;
import com.nimbusds.openid.connect.sdk.rp.*;
import com.nimbusds.openid.connect.sdk.util.*;



public class SSOServlet extends ServletBase  {
	private static final long serialVersionUID = 1L;
    static Logger log = Logger.getLogger(HomeServlet.class);  

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 
	{
		UserContext context = new UserContext(request);
		
		try {
		     URI authzEndpoint = new URI("https://cilogon.org/authorize");
		    //URI authzEndpoint = new URI("http://mvkrenz.grid.iu.edu");
		    // The client identifier provisioned by the server	\
		    
		     ClientID clientID = new ClientID(StaticConfig.conf.getProperty("cilogon.client_id"));
		    // The requested scope values for the token	\
		     String clientIDstr = StaticConfig.conf.getProperty("cilogon.client_id");
		    
		    Scope scope = new Scope("openid", "email","profile","org.cilogon.userinfo");
		    String scopestr = "scope=openid+email+profile+org.cilogon.userinfo";
		    Secret clientSecret = new Secret(StaticConfig.conf.getProperty("cilogon.client_secret"));
		    String clientSecretstr = StaticConfig.conf.getProperty("cilogon.client_secret");
		    // The client callback URI, typically pre-registered with the server \
		    		 

		    URI callback = new URI(StaticConfig.conf.getProperty("cilogon.callback"));

		    String redirectURLstr =StaticConfig.conf.getProperty("cilogon.callback");
		    // Generate random state string for pairing the response to the request \<commit_msg>sso updates<commit_after>package edu.iu.grid.oim.servlet;

////////////////////////////////
import edu.iu.grid.oim.lib.StaticConfig;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.DataOutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;
import org.json.*;
import javax.servlet.http.HttpSession;

import net.minidev.json.JSONObject;
import net.minidev.json.JSONValue;
import net.minidev.json.JSONArray;
import net.minidev.json.JSONStyle;
import net.minidev.json.parser.ParseException;

import java.io.UnsupportedEncodingException;
import java.util.*;

////////////////////////////////

import java.io.IOException;
import java.io.PrintWriter;
import java.sql.SQLException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
import com.divrep.DivRep;
import com.divrep.DivRepEvent;

import edu.iu.grid.oim.lib.Authorization;
import edu.iu.grid.oim.model.UserContext;
import edu.iu.grid.oim.model.db.ContactModel;
import edu.iu.grid.oim.model.db.record.ContactRecord;
import edu.iu.grid.oim.view.BootMenuView;
import edu.iu.grid.oim.view.BootPage;
import edu.iu.grid.oim.view.ContactAssociationView;
import edu.iu.grid.oim.view.GenericView;
import edu.iu.grid.oim.view.HtmlView;
import edu.iu.grid.oim.view.IView;
import edu.iu.grid.oim.view.LinkView;
import edu.iu.grid.oim.view.SideContentView;

///////////////////////
import java.net.URI;
import java.net.URL;

import com.nimbusds.oauth2.sdk.client.*;
import com.nimbusds.oauth2.sdk.token.*;
import com.nimbusds.oauth2.sdk.util.*;
import com.nimbusds.oauth2.sdk.id.*;
import com.nimbusds.oauth2.sdk.auth.*;
import com.nimbusds.oauth2.sdk.http.*;
import com.nimbusds.oauth2.sdk.*;

import com.nimbusds.openid.connect.sdk.*;
import com.nimbusds.openid.connect.sdk.claims.*;
import com.nimbusds.openid.connect.sdk.id.*;
import com.nimbusds.openid.connect.sdk.op.*;
import com.nimbusds.openid.connect.sdk.rp.*;
import com.nimbusds.openid.connect.sdk.util.*;



public class SSOServlet extends ServletBase  {
	private static final long serialVersionUID = 1L;
    static Logger log = Logger.getLogger(HomeServlet.class);  

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 
	{
		UserContext context = new UserContext(request);
		System.out.println("########hello");
		try {
		     URI authzEndpoint = new URI("https://cilogon.org/authorize");
		    //URI authzEndpoint = new URI("http://mvkrenz.grid.iu.edu");
		    // The client identifier provisioned by the server	\
		    
		     ClientID clientID = new ClientID(StaticConfig.conf.getProperty("cilogon.client_id"));
		    // The requested scope values for the token	\
		     String clientIDstr = StaticConfig.conf.getProperty("cilogon.client_id");
		    
		    Scope scope = new Scope("openid", "email","profile","org.cilogon.userinfo");
		    String scopestr = "scope=openid+email+profile+org.cilogon.userinfo";
		    Secret clientSecret = new Secret(StaticConfig.conf.getProperty("cilogon.client_secret"));
		    String clientSecretstr = StaticConfig.conf.getProperty("cilogon.client_secret");
		    // The client callback URI, typically pre-registered with the server \
		    		 

		    URI callback = new URI(StaticConfig.conf.getProperty("cilogon.callback"));

		    String redirectURLstr =StaticConfig.conf.getProperty("cilogon.callback");
		    // Generate random state string for pairing the response to the request \
{'fraction_non_alphanumeric': 0.1435108153078203, 'fraction_numerical': 0.0024958402662229617, 'mean_word_length': 4.002080443828016, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '122942', 'n_tokens_mistral': 2384, 'n_tokens_neox': 2308, 'n_words': 418}