Exemple #1
0
app.get( '/api/token', function( req, res ) {
    imf.getAuthorizationHeader().then( function( token ) {
        res.send( 200, token );
    }, function( error ) {
        console.log( error );
    } );    
} );
app.get('/publicServices/generateToken', function(req, res){
		// use imf-oauth-user-sdk to get the authorization header, which can be used to access the protected resource/endpoint by imf-backend-strategy
		imf.getAuthorizationHeader().then(function(token) {
			res.send(200, token);
		}, function(err) {
			console.log(err);
		});
	}