Subversion Repositories oidplus

Rev

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

Rev 1305 Rev 1314
Line 93... Line 93...
93
                        }
93
                        }
94
 
94
 
95
                        $gen = OIDplusAuthContentStoreJWT::JWT_GENERATOR_AJAX;
95
                        $gen = OIDplusAuthContentStoreJWT::JWT_GENERATOR_AJAX;
96
                        $sub = $ra_email;
96
                        $sub = $ra_email;
97
 
97
 
98
                        $authSimulation = new OIDplusAuthContentStoreJWT();
-
 
99
                        $authSimulation->raLogin($ra_email);
-
 
100
                        $authSimulation->setValue(OIDplusAuthContentStoreJWT::CLAIM_GENERATOR, $gen);
98
                        $token = OIDplusAuthContentStoreJWT::craftJWT([$sub], false, $gen);
101
                        $token = $authSimulation->getJWTToken();
-
 
102
 
99
 
103
                        $out['text'] .= '<p>'._L('You can make automated calls to your OIDplus account by calling the AJAX API.').'</p>';
100
                        $out['text'] .= '<p>'._L('You can make automated calls to your OIDplus account by calling the AJAX API.').'</p>';
104
                        $out['text'] .= '<p>'._L('The URL for the AJAX script is:').'</p>';
101
                        $out['text'] .= '<p>'._L('The URL for the AJAX script is:').'</p>';
105
                        $out['text'] .= '<p><b>'.OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE_CANONICAL).'ajax.php</b></p>';
102
                        $out['text'] .= '<p><b>'.OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE_CANONICAL).'ajax.php</b></p>';
106
                        $out['text'] .= '<p>'._L('You must at least provide following fields:').'</p>';
103
                        $out['text'] .= '<p>'._L('You must at least provide following fields:').'</p>';
107
                        $out['text'] .= '<p><pre id="oidplus_auth_jwt">';
104
                        $out['text'] .= '<p><pre id="oidplus_auth_jwt">';
108
                        $out['text'] .= htmlentities(OIDplusAuthContentStoreJWT::COOKIE_NAME).' = "'.htmlentities($token).'"'."\n";
105
                        $out['text'] .= htmlentities(OIDplusAuthContentStoreJWT::COOKIE_NAME).' = "'.htmlentities($token).'"'."\n";
109
                        $out['text'] .= '</pre></p>';
106
                        $out['text'] .= '</pre></p>';
110
                        $out['text'] .= '<p><input type="button" value="'._L('Copy to clipboard').'" onClick="copyToClipboard(oidplus_auth_jwt)"></p>';
107
                        $out['text'] .= '<p><input type="button" value="'._L('Copy to clipboard').'" onClick="copyToClipboard(oidplus_auth_jwt)"></p>';
111
                        $out['text'] .= '<p>'._L('Please keep this information confidential!').'</p>';
108
                        $out['text'] .= '<p>'._L('Please keep this information confidential!').'</p>';
112
                        $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>';
109
                        $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>';
113
                        $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>';
110
                        $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>';
114
 
111
 
115
                        $out['text'] .= '<h2>'._L('Blacklisted tokens').'</h2>';
112
                        $out['text'] .= '<h2>'._L('Blacklisted tokens').'</h2>';
116
                        $bl_time = OIDplusAuthContentStoreJWT::jwtGetBlacklistTime($gen, $sub);
113
                        $bl_time = OIDplusAuthContentStoreJWT::jwtGetBlacklistTime($gen, $sub);
117
                        if ($bl_time == 0) {
114
                        if ($bl_time == 0) {