diff --git a/index.html b/index.html
index e0e45bf..a37f861 100644
--- a/index.html
+++ b/index.html
@@ -120,7 +120,7 @@
-
+
diff --git a/js/mock.js b/js/issuer.js
similarity index 98%
rename from js/mock.js
rename to js/issuer.js
index 233e4f8..626da4a 100644
--- a/js/mock.js
+++ b/js/issuer.js
@@ -384,7 +384,10 @@ $(function () {
}
// Session initialization
- return $.ajax({ url: '.well-known/oauth3/directives.json' }).then(function (directives) {
+ return OAUTH3.discover(
+ OAUTH3.clientUri(window.location)
+ , { client_uri: OAUTH3.clientUri(window.location) }
+ ).then(function (directives) {
// TODO cache directives in memory (and storage)
CONFIG.directives = directives;
directives.issuer = directives.issuer || (window.location.host + window.location.pathname).replace(/\/$/, '');