Subversion Repositories oidplus

Rev

Rev 1305 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1305 Rev 1314
Line 86... Line 86...
86
                        }
86
                        }
87
 
87
 
88
                        $gen = OIDplusAuthContentStoreJWT::JWT_GENERATOR_AJAX;
88
                        $gen = OIDplusAuthContentStoreJWT::JWT_GENERATOR_AJAX;
89
                        $sub = 'admin';
89
                        $sub = 'admin';
90
 
90
 
91
                        $authSimulation = new OIDplusAuthContentStoreJWT();
-
 
92
                        $authSimulation->adminLogin();
-
 
93
                        $authSimulation->setValue(OIDplusAuthContentStoreJWT::CLAIM_GENERATOR, $gen);
91
                        $token = OIDplusAuthContentStoreJWT::craftJWT([], true, $gen);
94
                        $token = $authSimulation->getJWTToken();
-
 
95
 
92
 
96
                        $out['text'] .= '<p>'._L('You can make automated calls to your OIDplus account by calling the AJAX API.').'</p>';
93
                        $out['text'] .= '<p>'._L('You can make automated calls to your OIDplus account by calling the AJAX API.').'</p>';
97
                        $out['text'] .= '<p>'._L('The URL for the AJAX script is:').'</p>';
94
                        $out['text'] .= '<p>'._L('The URL for the AJAX script is:').'</p>';
98
                        $out['text'] .= '<p><b>'.OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE_CANONICAL).'ajax.php</b></p>';
95
                        $out['text'] .= '<p><b>'.OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE_CANONICAL).'ajax.php</b></p>';
99
                        $out['text'] .= '<p>'._L('You must at least provide following fields:').'</p>';
96
                        $out['text'] .= '<p>'._L('You must at least provide following fields:').'</p>';
100
                        $out['text'] .= '<p><pre id="oidplus_auth_jwt">';
97
                        $out['text'] .= '<p><pre id="oidplus_auth_jwt">';
101
                        $out['text'] .= htmlentities(OIDplusAuthContentStoreJWT::COOKIE_NAME).' = "'.htmlentities($token).'"'."\n";
98
                        $out['text'] .= htmlentities(OIDplusAuthContentStoreJWT::COOKIE_NAME).' = "'.htmlentities($token).'"'."\n";
102
                        $out['text'] .= '</pre></p>';
99
                        $out['text'] .= '</pre></p>';
103
                        $out['text'] .= '<p><input type="button" value="'._L('Copy to clipboard').'" onClick="copyToClipboard(oidplus_auth_jwt)"></p>';
100
                        $out['text'] .= '<p><input type="button" value="'._L('Copy to clipboard').'" onClick="copyToClipboard(oidplus_auth_jwt)"></p>';
104
                        $out['text'] .= '<p>'._L('Please keep this information confidential!').'</p>';
101
                        $out['text'] .= '<p>'._L('Please keep this information confidential!').'</p>';
105
                        $out['text'] .= '<p>'._L('The JWT-token (secret!) will automatically perform a one-time-login to fulfill the request. The other fields are the normal fields which are called during the usual operation of OIDplus.').'</p>';
102
                        $out['text'] .= '<p>'._L('The JWT-token (secret!) will automatically perform a login to fulfill the request. The other fields are the normal fields which are called during the usual operation of OIDplus.').'</p>';
106
                        $out['text'] .= '<p>'._L('Currently, there is no documentation for the AJAX calls. However, you can look at the <b>script.js</b> files of the plugins to see the field names being used. You can also enable network analysis in your web browser debugger (F12) to see the request headers sent to the server during the operation of OIDplus.').'</p>';
103
                        $out['text'] .= '<p>'._L('Currently, there is no documentation for the AJAX calls. However, you can look at the <b>script.js</b> files of the plugins to see the field names being used. You can also enable network analysis in your web browser debugger (F12) to see the request headers sent to the server during the operation of OIDplus.').'</p>';
107
 
104
 
108
                        $out['text'] .= '<h2>'._L('Blacklisted tokens').'</h2>';
105
                        $out['text'] .= '<h2>'._L('Blacklisted tokens').'</h2>';
109
                        $bl_time = OIDplusAuthContentStoreJWT::jwtGetBlacklistTime($gen, $sub);
106
                        $bl_time = OIDplusAuthContentStoreJWT::jwtGetBlacklistTime($gen, $sub);
110
                        if ($bl_time == 0) {
107
                        if ($bl_time == 0) {