Show oauth client credentials in webadmin

This commit is contained in:
Johannes Zellner
2014-09-22 17:08:27 -07:00
parent 24bd8070cd
commit 2c97b89524
2 changed files with 9 additions and 3 deletions
+1 -1
View File
@@ -107,7 +107,7 @@ function getActiveClientsByUserId(userId, callback) {
assert(typeof userId === 'string');
assert(typeof callback === 'function');
database.all('SELECT tokens.accessToken,tokens.clientId,clients.name,scope,COUNT(*) AS tokens FROM tokens,clients WHERE tokens.clientId=clients.id AND userId=? GROUP BY tokens.clientId', [ userId ], function (error, results) {
database.all('SELECT tokens.accessToken,clients.clientId,clients.clientSecret,clients.name,scope,COUNT(*) AS tokens FROM tokens,clients WHERE tokens.clientId=clients.id AND userId=? GROUP BY tokens.clientId', [ userId ], function (error, results) {
if (error) return callback(new DatabaseError(DatabaseError.INTERNAL_ERROR, error));
if (typeof results === 'undefined') results = [];
+8 -2
View File
@@ -10,14 +10,20 @@
<div class="panel-group" id="accordion">
<div class="panel panel-default" ng-repeat="client in activeClients">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" data-target="#collapse{{client.clientId}}" href="">{{client.name}}</a>
<h4 class="panel-title" data-toggle="collapse" data-parent="#accordion" data-target="#collapse{{client.clientId}}" style="cursor: pointer;">
{{client.name}}
</h4>
</div>
<div id="collapse{{client.clientId}}" class="panel-collapse collapse in">
<div class="panel-body">
<h4>Details</h4>
<p>Permissions: <b>{{ client.scope }}</b></p>
<p>Provided Tokens: <b>{{ client.tokens }}</b></p>
<br/>
<h4>Credentials</h4>
<p>Client ID: <b>{{ client.clientId }}</b></p>
<p>Client Secret: <b>{{ client.clientSecret }}</b></p>
<br/>
<button class="btn btn-xs btn-danger" ng-click="delTokensByClientId(client)">Revoke access</button>
</div>
</div>