Please try to add following between line 40 and 41 to the lambda function from @awarecan:
if scope is None:
# token is in grantee for Linking directive
scope = directive.get('payload', {}).get('grantee')
seem to work for me and I don’t need the long lived access token.