From 99d081141243ec14a1b52f2f19a5e28eb62afa00 Mon Sep 17 00:00:00 2001 From: Stefan Guilhen Date: Thu, 15 Mar 2018 09:53:58 -0300 Subject: [PATCH] [KEYCLOAK-5886] Improvements to Photoz example - Fixed location of the authz json file in the README - Added links to allow easy navigation back to the main page - requestEntitlements link now properly display the RPT --- examples/authz/photoz/README.md | 2 +- .../photoz/photoz-html5-client/src/main/webapp/js/app.js | 7 ++++++- .../src/main/webapp/partials/admin/albums.html | 7 +++++-- .../src/main/webapp/partials/album/create.html | 4 ++-- .../src/main/webapp/partials/album/detail.html | 5 ++++- .../src/main/webapp/partials/profile.html | 5 ++++- 6 files changed, 22 insertions(+), 8 deletions(-) diff --git a/examples/authz/photoz/README.md b/examples/authz/photoz/README.md index 8ae6b7c95f..7dedbff630 100644 --- a/examples/authz/photoz/README.md +++ b/examples/authz/photoz/README.md @@ -73,7 +73,7 @@ open the ``Client Details`` page. Once there, click on the `Authorization` tab. Click on the ``Select file`` button, which means you want to import a resource server configuration. Now select the file that is located at: - examples/authz/photoz/photoz-restful-api/src/main/resources/photoz-restful-api-authz-service.json + examples/authz/photoz/photoz-restful-api/target/classes/photoz-restful-api-authz-service.json Now click ``Upload`` and the resource server will be updated accordingly. diff --git a/examples/authz/photoz/photoz-html5-client/src/main/webapp/js/app.js b/examples/authz/photoz/photoz-html5-client/src/main/webapp/js/app.js index b552391ca2..0a6bf48c2a 100755 --- a/examples/authz/photoz/photoz-html5-client/src/main/webapp/js/app.js +++ b/examples/authz/photoz/photoz-html5-client/src/main/webapp/js/app.js @@ -82,7 +82,9 @@ module.controller('TokenCtrl', function ($scope, Identity) { } $scope.requestEntitlements = function () { - Identity.authorization.entitlement('photoz-restful-api').then(function (rpt) {}); + Identity.authorization.entitlement('photoz-restful-api').then(function (rpt) { + $scope.showRpt() + }); } $scope.Identity = Identity; @@ -99,6 +101,9 @@ module.controller('AlbumCtrl', function ($scope, $http, $routeParams, $location, $location.path('/'); }); }; + $scope.goto = function (path) { + $location.path(path) + } }); module.controller('ProfileCtrl', function ($scope, $http, $routeParams, $location, Profile) { diff --git a/examples/authz/photoz/photoz-html5-client/src/main/webapp/partials/admin/albums.html b/examples/authz/photoz/photoz-html5-client/src/main/webapp/partials/admin/albums.html index c0cc6e1834..0f4da1461a 100644 --- a/examples/authz/photoz/photoz-html5-client/src/main/webapp/partials/admin/albums.html +++ b/examples/authz/photoz/photoz-html5-client/src/main/webapp/partials/admin/albums.html @@ -1,4 +1,4 @@ -

All Albums

+

All Albums

@@ -16,4 +16,7 @@ -
\ No newline at end of file + +

+Back to main page +

\ No newline at end of file diff --git a/examples/authz/photoz/photoz-html5-client/src/main/webapp/partials/album/create.html b/examples/authz/photoz/photoz-html5-client/src/main/webapp/partials/album/create.html index d9ddd25813..0433f49d4b 100644 --- a/examples/authz/photoz/photoz-html5-client/src/main/webapp/partials/album/create.html +++ b/examples/authz/photoz/photoz-html5-client/src/main/webapp/partials/album/create.html @@ -1,7 +1,7 @@ -

Create an Album

+

Create an Album

Name: - +
diff --git a/examples/authz/photoz/photoz-html5-client/src/main/webapp/partials/album/detail.html b/examples/authz/photoz/photoz-html5-client/src/main/webapp/partials/album/detail.html index cf32df1480..096e08cf5c 100644 --- a/examples/authz/photoz/photoz-html5-client/src/main/webapp/partials/album/detail.html +++ b/examples/authz/photoz/photoz-html5-client/src/main/webapp/partials/album/detail.html @@ -1 +1,4 @@ -

{{album.name}}

\ No newline at end of file +

{{album.name}}

+ +
Back to albums
+
Back to main page
\ No newline at end of file diff --git a/examples/authz/photoz/photoz-html5-client/src/main/webapp/partials/profile.html b/examples/authz/photoz/photoz-html5-client/src/main/webapp/partials/profile.html index c6f6750a4c..4cf5d142f8 100644 --- a/examples/authz/photoz/photoz-html5-client/src/main/webapp/partials/profile.html +++ b/examples/authz/photoz/photoz-html5-client/src/main/webapp/partials/profile.html @@ -1,6 +1,9 @@ -

My Profile

+

My Profile

Name: {{profile.userName}}

Total of albums: {{profile.totalAlbums}}

+

+ Back to main page +