Files

57 lines
2.6 KiB
HTML
Raw Permalink Normal View History

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>OAuth Account Login Page</title>
<!-- Bootstrap CDN-->
<!-- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"> -->
</head>
<body>
<h1><%= title %></h1>
<!-- 用户点击「登录」按钮时,此页面发起 POST /users/authorize?{{query}} 请求并获取授权码-->
<!-- 此时,会调用 OAuth 服务器实现的该路由接口,验证客户端和用户身份后,创建并返回授权码-->
<!-- app.all('/users/authorize', app.oAuth2Server.authorize()); // 获取授权码-->
<!-- 此模式下,授权码会通过重定向 URL 返回给客户端-->
<!-- 授权码模式需要的信息:username,password,client_secret -->
<!-- 密码模式需要的信息:username,password,client_secret,grant_type,client_id -->
<!-- 客户端模式需要的信息:refresh_token -->
<!-- 刷新token模式需要的信息:client_secret,grant_type,client_id,refresh_token -->
<!-- 授权码模式访问:/user/authorize -->
<form action="/user/authorize?<%=query%>" method="post">
<!-- 密码模式,客户端模式,刷新token模式访问:/user/token -->
<!-- <form action="/user/token?<%=query%>" method="post"> -->
<div class="form-group">
<label for="username">用户名</label>
<input type="text" class="form-control" id="username" name='username'>
</div>
<div class="form-group">
<label for="password">密码</label>
<input type="password" class="form-control" id="password" name='password'>
</div>
<div class="form-group">
<label for="client_secret">client_secret</label>
<input type="text" class="form-control" id="client_secret" name='client_secret'>
</div>
<div class="form-group">
<label for="grant_type">grant_type</label>
<input type="text" class="form-control" id="grant_type" name='grant_type'>
</div>
<div class="form-group">
<label for="client_id">client_id</label>
<input type="text" class="form-control" id="client_id" name='client_id'>
</div>
<div class="form-group">
<label for="refresh_token">refresh_token</label>
<input type="text" class="form-control" id="refresh_token" name='refresh_token'>
</div>
<button type="submit" class="btn btn-primary">登录</button>
</form>
</body>
</html>