Rev 1305 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1305 | Rev 1314 | ||
---|---|---|---|
Line 112... | Line 112... | ||
112 | } |
112 | } |
113 | 113 | ||
114 | $gen = OIDplusAuthContentStoreJWT::JWT_GENERATOR_REST; |
114 | $gen = OIDplusAuthContentStoreJWT::JWT_GENERATOR_REST; |
115 | $sub = $ra_email; |
115 | $sub = $ra_email; |
116 | 116 | ||
117 | $authSimulation = new OIDplusAuthContentStoreJWT(); |
- | |
118 | $authSimulation->raLogin($ra_email); |
- | |
119 | $authSimulation->setValue(OIDplusAuthContentStoreJWT::CLAIM_GENERATOR, $gen); |
117 | $token = OIDplusAuthContentStoreJWT::craftJWT([$sub], false, $gen); |
120 | $token = $authSimulation->getJWTToken(); |
- | |
121 | 118 | ||
122 | $out['text'] .= '<p>'._L('You can make automated calls to your OIDplus account by calling an REST API.').'</p>'; |
119 | $out['text'] .= '<p>'._L('You can make automated calls to your OIDplus account by calling an REST API.').'</p>'; |
123 | $out['text'] .= '<h2>'._L('Endpoints').'</h2>'; |
120 | $out['text'] .= '<h2>'._L('Endpoints').'</h2>'; |
124 | $endpoints = ''; |
121 | $endpoints = ''; |
125 | foreach (OIDplus::getAllPlugins() as $plugin) { |
122 | foreach (OIDplus::getAllPlugins() as $plugin) { |
Line 139... | Line 136... | ||
139 | $out['text'] .= '<p><pre id="oidplus_auth_jwt">'; |
136 | $out['text'] .= '<p><pre id="oidplus_auth_jwt">'; |
140 | $out['text'] .= 'Authentication: Bearer '.htmlentities($token)."\n"; |
137 | $out['text'] .= 'Authentication: Bearer '.htmlentities($token)."\n"; |
141 | $out['text'] .= '</pre></p>'; |
138 | $out['text'] .= '</pre></p>'; |
142 | $out['text'] .= '<p><input type="button" value="'._L('Copy to clipboard').'" onClick="copyToClipboard(oidplus_auth_jwt)"></p>'; |
139 | $out['text'] .= '<p><input type="button" value="'._L('Copy to clipboard').'" onClick="copyToClipboard(oidplus_auth_jwt)"></p>'; |
143 | $out['text'] .= '<p>'._L('Please keep this information confidential!').'</p>'; |
140 | $out['text'] .= '<p>'._L('Please keep this information confidential!').'</p>'; |
144 | $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>'; |
- | |
145 | 141 | ||
146 | $out['text'] .= '<h2>'._L('Blacklisted tokens').'</h2>'; |
142 | $out['text'] .= '<h2>'._L('Blacklisted tokens').'</h2>'; |
147 | $bl_time = OIDplusAuthContentStoreJWT::jwtGetBlacklistTime($gen, $sub); |
143 | $bl_time = OIDplusAuthContentStoreJWT::jwtGetBlacklistTime($gen, $sub); |
148 | if ($bl_time == 0) { |
144 | if ($bl_time == 0) { |
149 | $out['text'] .= '<p>'._L('None of the previously generated JWT tokens have been blacklisted.').'</p>'; |
145 | $out['text'] .= '<p>'._L('None of the previously generated JWT tokens have been blacklisted.').'</p>'; |