Permalink
Find file
c8e01de Nov 4, 2015
220 lines (198 sloc) 9.17 KB
<!DOCTYPE html>
<html>
<head>
<title>AWS Auth</title>
<link href="/img/logo.png" rel="icon">
<link href="/css/bootstrap.min.css" rel="stylesheet" />
<link href="css/bootstrap-social.css" rel="stylesheet" />
<link href="css/default.css" rel="stylesheet" />
<script src="/js/jquery-2.1.4.min.js"></script>
<script src="/js/ss-utils.js"></script>
<script src="js/autogrid.js"></script>
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="/" style="" title="Home">
<img src="/img/logo.png" alt="Home" />
<b>AWS Auth</b>
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="container body-content">
<div class="row" style="margin: 20px 0 0 0;">
<div class="col-lg-6">
@if (base.IsAuthenticated)
{
<h2 class="success">Authenticated!</h2>
}
else
{
<h2 class="error">Not Authenticated</h2>
}
<form id="form-login" action="/auth/credentials" method="POST">
<div class="wrapper"><div class="error-summary"></div></div>
<div class="form-group">
<input class="form-control input-lg" id="userName" name="userName" type="text" placeholder="UserName" value="test">
</div>
<div class="form-group form-inline">
<input class="form-control input-lg" id="password" name="password" type="text" placeholder="Password" value="test">
<button type="submit" class="btn btn-lg btn-default">Login</button>
</div>
<div style="margin: 10px">
<b>Quick Login:</b>
<span data-click="switchUser:test">test</span>,
<span data-click="switchUser:test2">test2</span>,
<span data-click="switchUser:new.user@@gmail.com">new.user</span>
</div>
</form>
<form action="/auth/logout">
<input type="hidden" name="continue" value="/awsauth/" />
<button type="submit" class="btn btn-default">Logout</button>
</form>
</div>
<div class="col-lg-6">
<h2 style="margin: 30px 0 0 0;">ServiceStack Status</h2>
<div id="status"></div>
<table class="table table-striped" style="margin: 20px 0 0 0">
<tr>
<th colspan="2">ServiceStack Auth &amp; Session Links:</th>
</tr>
<tr>
<th>View Session Info</th>
<td><a href="/awsauth/userinfo">/awsauth/userinfo</a></td>
</tr>
<tr>
<th>Requires Auth Service</th>
<td><a href="/awsauth/RequiresAuth">/awsauth/RequiresAuth</a></td>
</tr>
<tr>
<th>Requires Role Service</th>
<td><a href="/awsauth/RequiresRole">/awsauth/RequiresRole</a></td>
</tr>
<tr>
<th>Reset All User Info</th>
<td><a href="/awsauth/reset">/awsauth/reset</a></td>
</tr>
</table>
</div>
</div>
<hr />
<div class="row">
<div class="col-lg-6">
<h3>Sign in with 3rd Party Providers</h3>
<div style="float: left; width: 250px; padding: 0 0 0 0;">
<a class="btn btn-block btn-social btn-twitter" href="/auth/twitter">
<b class="fa fa-twitter">T</b>Sign in with Twitter
</a>
<a class="btn btn-block btn-social btn-facebook" href="/auth/facebook">
<b class="fa fa-facebook">fb</b>Sign in with Facebook
</a>
<a class="btn btn-block btn-social btn-github" href="/auth/github">
<b class="fa fa-github"></b>Sign in with GitHub
</a>
<a class="btn btn-block btn-social btn-google-plus" href="/auth/GoogleOAuth">
<b class="fa fa-google-plus">G</b>Sign in with Google
</a>
<a class="btn btn-block btn-social btn-yahoo" href="/auth/YahooOpenId">
<b class="fa fa-yahoo">Y!</b>Sign in with Yahoo
</a>
<a class="btn btn-block btn-social btn-linkedin" href="/auth/LinkedIn">
<b class="fa fa-linkedin">in</b>Sign in with LinkedIn
</a>
</div>
</div>
<div class="col-lg-6">
<h3>Register New User</h3>
<form id="form-register" action="/register" method="POST">
<div class="form-group">
<input class="form-control input-lg" type="text" name="FirstName" value="New" placeholder="First Name">
<span class="help-block"></span>
</div>
<div class="form-group">
<input class="form-control input-lg" type="text" name="LastName" value="User" placeholder="Last Name">
<span class="help-block"></span>
</div>
<div class="form-group">
<input class="form-control input-lg" type="text" name="Email" value="new.user@gmail.com" placeholder="Email">
<span class="help-block"></span>
</div>
<div class="form-group">
<input class="form-control input-lg" type="text" name="Password" value="test" placeholder="Password">
<span class="help-block"></span>
</div>
<div class="form-group">
<input type="checkbox" id="chkAutoLogin" name="AutoLogin" value="true" checked="checked">
<label for="chkAutoLogin">Auto Login</label>
</div>
<div class="form-group">
<button class="btn btn-lg btn-default" type="submit">Register</button>
</div>
<div class="clearfix"></div>
</form>
</div>
</div>
<a href="https://github.com/ServiceStackApps/AwsApps/tree/master/src/AwsApps/awsauth">
<img style="position:absolute;top:0;right:0;border:0;z-index:1031"
src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"
alt="Fork me on GitHub">
</a>
</div>
<div id="userinfo" style="padding:10px; display:none;">
<h3>User Auth</h3>
<div class="autogrid" id="userauth"></div>
<h3>User Auth Details</h3>
<div class="autogrid" id="userauthdetails"></div>
</div>
<script type="text/javascript">
$.getJSON("/auth", function (r) {
var html = "<h4 class='success'>Authenticated!</h4>"
+ "<table>"
+ $.map(r, function (k, v) {
return "<tr><th>" + v + "<th>"
+ "<td>" + (typeof k == 'string' ? k : JSON.stringify(k)) + "</td></tr>";
}).join('')
+ "</table>";
$("#status").html(html);
if (r['userName'])
$("#userName").val(r['userName']);
$.getJSON("/awsauth/userinfo", function(r) {
$("#userinfo").show();
if (r.userAuth)
$("#userauth").html(autogrid([r.userAuth]));
if (r.userAuthDetails)
$("#userauthdetails").html(autogrid(r.userAuthDetails));
});
}).error(function () {
$("#status").html("<h4 class='error'>Not Authenticated</h4>");
});
$(document).bindHandlers({
switchUser: function (u) {
$("#userName").val(u);
$("#password").val('test');
}
});
$("#form-login").bindForm({
success: function(r) {
location.href = '@base.Request.QueryString["redirect"]' || '/awsauth/';
}
});
$("#form-register").bindForm({
success: function (r) { location.href = '/awsauth/'; }
});
</script>
</body>
</html>