Hazel Mahmud

Hazel Mahmud

  • NA
  • 299
  • 65.8k

pass login and password to asp .net c# page

Feb 4 2017 11:43 PM
can someone help on how to pass login and password from the code below that i have attach to an asp .net c# page.. The login and password are retrieve from Active Directory data. Code are as below :
 
 
<%@ page language="java" %>
<%@ page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ page import="java.util.*" %>
<%@ page import="com.novell.nidp.*" %>
<%@ page import="com.novell.nidp.servlets.*" %>
<%@ page import="com.novell.nidp.resource.*" %>
<%@ page import="com.novell.nidp.resource.jsp.*" %>
<%@ page import="com.novell.nidp.ui.*" %>
<%@ page import="org.apache.commons.lang.StringEscapeUtils" %>


<%
ContentHandler handler = new ContentHandler(request,response);
String target = (String) request.getAttribute("target");
String uname = (String)request.getAttribute("username");
if ( uname == null )
uname = "";
uname = StringEscapeUtils.escapeHtml(uname);
if ( target != null )
target = StringEscapeUtils.escapeHtml(target);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//<%=handler.getLanguageCode()%>" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>UUM Single Sign-On</title>


<style type="text/css">
body{
margin: 0;
font-family: "Helvetica Neue","Arial",sans-serif;
}
#bg{
position: fixed;
top: -50%;
left: -50%;
width: 100%;
height: 100%;
z-index: -1;
}
#bg img{
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
min-width: 50%;
min-height: 50%;
}
#loginbox{
/*max-width: 350px;*/
max-width: 100%;
position: absolute;
left: 20px;
top: 100px;
padding: 10px;
background: rgba(255, 255, 255, .5);
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#6cffffff', endColorstr='#6cffffff'); /* IE */
width: 300px;
}
h1#title{
background: rgba(0, 0, 0, .4);
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#8c000000', endColorstr='#8c000000'); /* IE */
margin: 0;
color: #ffffff;
font-weight: lighter;
font-size: 20px;
/*padding: 13px;*/
padding: 5px;
@media (min-width: 400px) {
width: 300px;
}
}
h1#footer{
background: rgba(0, 0, 0, .5);
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#8c000000', endColorstr='#8c000000'); /* IE */
margin: 0;
color: #FFF;
font-weight: lighter;
font-size: 20px;
/*padding: 13px;*/
padding: 10px;
}
.inputText{
-webkit-appearance: none;
outline: none;
border: none;
margin: 3px;
font-size: 15px;
padding: 5px;
width: 150px;
}
input#login{ /*inputbutton*/
border: none;
background-color: #237BDB;
font-size: 14px;
padding: 6px;
width: 150px;
color: #FFF;
cursor: pointer;
margin: 3px;
}
input#login:hover{
background-color: #17508D;
}
p#errormsg{
width: 300px;
margin: 12px;
padding: 3px;
font-size: 14px;
text-align: center;
color: #FFF;
}
.sideLabel{
width: 320px;
margin: 3px;
text-align: center;
font-size: 13px;
color: #747474;
}
#credit{
background: rgba(0, 0, 0, .7);
position: absolute;
bottom: 0px;
right: 0;
left: 0;
color: #FFF;
text-align: center;
font-size: 15px;
padding: 5px;

}
#nojs{
text-align: center;
padding: 4px;
font-size: 11px;
background-color: #B84A4A;
color: #FFF;
}
.label{
font-size: 12px;
font-weight: bold;
}

.register{
font-size: 11px;
float: right;
}

.register a{
font-weight:bold;
text-decoration:none;
color : #FFFF00;
font-size: 12px;
}
.register a:hover{
color: #001D79;
font-weight: bold;
text-decoration: none;
font-size: 12px;
}

a:link {
color: #FFFFFF;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #FFFFFF;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
}


.shadow{
box-shadow: 1px 1px 5px 1px #000;
}
.sso_box{
margin-top:25px;

}
.header_box{
/*background-image: url("barline-atas.jpg");*/
background-image: url("bannersingleasignon.jpg");
/*background-image: url("images/background2.jpg");*/
background-color:maroon;
}

.content_box{
background-color:#C0C0C0;
}
.footer_box{
/*background-image: url("images/barline-bawah.png");*/
background-color:maroon;
min-height:34px;
font-size:11px;
color:#FFF;
}
.content_box div{
min-height:25px;
}

.content_box1{
height:30px;
}

@media (min-width: 468px) {
.container {
width: 450px;
}

}

@media (max-width: 768px) {
.tanggo3{
width:70%;
display:hide
}

}



</style>

<link rel="stylesheet" href="<%= request.getContextPath() %>/css/supersized.css" type="text/css" media="screen" />

<script type="text/javascript" src="<%= request.getContextPath() %>/js/jquery15.js"></script>
<script type="text/javascript" src="<%= request.getContextPath() %>/js/supersized.3.1.3.js"></script>

<script type="text/javascript">
jQuery(function($){

$.supersized({
//Functionality
slideshow : 1, //Slideshow on/off
autoplay : 1, //Slideshow starts playing automatically
start_slide : 1, //Start slide (0 is random)
random : 0, //Randomize slide order (Ignores start slide)
slide_interval : 20000, //Length between transitions
transition : 1, //0-None, 1-Fade, 2-Slide Top, 3-Slide Right, 4-Slide Bottom, 5-Slide Left, 6-Carousel Right, 7-Carousel Left
transition_speed : 500, //Speed of transition
new_window : 1, //Image links open in new window/tab
pause_hover : 0, //Pause slideshow on hover
keyboard_nav : 1, //Keyboard navigation on/off
performance : 1, //0-Normal, 1-Hybrid speed/quality, 2-Optimizes image quality, 3-Optimizes transition speed // (Only works for Firefox/IE, not Webkit)
image_protect : 0, //Disables image dragging and right click with Javascript
image_path : 'img/', //Default image path

//Size & Position
min_width : 0, //Min width allowed (in pixels)
min_height : 0, //Min height allowed (in pixels)
vertical_center : 1, //Vertically center background
horizontal_center : 1, //Horizontally center background
fit_portrait : 1, //Portrait images will not exceed browser height
fit_landscape : 0, //Landscape images will not exceed browser width

//Components
navigation : 1, //Slideshow controls on/off
thumbnail_navigation : 1, //Thumbnail navigation
slide_counter : 1, //Display slide numbers
slide_captions : 1, //Slide caption (Pull from "title" in slides array)
slides : [ //Slideshow Images

{image : '<%= request.getContextPath() %>/images/uum1.jpg', title : '', url :''},
{image : '<%= request.getContextPath() %>/images/uum2.jpg', title : '', url : 'brochure.pdf', target :'_blank'},
{image : '<%= request.getContextPath() %>/images/uum3.jpg', title : '', url : ''},
{image : '<%= request.getContextPath() %>/images/uum4.jpg', title : '', url : ''}
]


});
});

</script>

<style type="text/css">
<!--
.style1 {color: #FFFF00}
-->
</style>
</head>
<body onLoad="document.form1.userID.focus();">

<form name="IDPLogin" enctype="application/x-www-form-urlencoded" method="POST" action="<%= (String) request.getAttribute("url") %>" AUTOCOMPLETE="off">
<input type="hidden" name="option" value="credential">
<% if (target != null) { %>
<input type="hidden" name="target" value="<%=target%>">
<% } %>


<div style="display:none">
<input type="radio" name="User_Type" value="stafsso" checked="checked">&nbsp;Staff&nbsp;
<input type="radio"name="User_Type" value="studentsso" onClick="window.open('http://')">&nbsp;Student&nbsp;

<input type="radio" name="User_Type" value="others" onClick="window.open('http://umis.uum.edu.my')">&nbsp;Public
</div>
<h1 id="title"><img src="<%= request.getContextPath() %>/images/bannerPortal.png">
<input name="Ecom_User_ID" type="text" class="inputText" autocomplete="off" placeholder="Username"/>
<input name="Ecom_Password" type="password" class="inputText" autocomplete="off" placeholder="Password"/>
<input name="B1" type="submit" class="inputButton" id="login" value="Login" onClick="if(form1.userID.value != '' && form1.userPassword.value != '') {return true;} else {alert('Sila isikan Nama Pengguna dan Kata Laluan anda.'); form1.userID.focus(); return false; }" />


<%
String err = (String) request.getAttribute(NIDPConstants.ATTR_LOGIN_ERROR);

if (err != null)
{
%>

<div>
<font face="Arial" color="FF00000" size="4"><%=err%></font>
</div>

<% } %>
</h1>
</form>


</body>
</html>




 

Answers (1)