O365 SSO with Google - Getting AADSTS20001 error

resolved.
some bugs in the Rules in the post.
for the function assignOffice365License(), should add method:‘POST’ in options, or else it won’t work.

but now there is another problem.
See: