Hi Azure also provide a refresh token that is much longer living then the auth tokens which can be used for example to maintain access to a particular resource or gain access to another resource without requiring the user to provide log in credentials again.

In my case this is useful since the openid_connect_windows_aad module provides the infrastructure for authentication and Drupal account creation, but I can create a add on module using hook_openid_connect_post_authorize() to access other REST services.

I'll provide a simple patch that just adds the 'refresh' token to the $tokens array.

Comments

acrazyanimal created an issue. See original summary.

acrazyanimal’s picture

StatusFileSize
new799 bytes

Here is the patch. I will try and add a patch for D8 as well, but in a separate issue.

acrazyanimal’s picture

Title: Pass along the Azure refresh token as well. » 7.x-1.x - Pass along the Azure refresh token from retrieveTokens().
Related issues: +#2944190: 8.x-1.x - Pass along the Azure refresh token from retrieveTokens().

Updating the name so its more clear that this is for D7.

Also created an issue for D8L #2944190: 8.x-1.x - Pass along the Azure refresh token from retrieveTokens().

acrazyanimal’s picture

Status: Active » Needs review
davej’s picture

#2 tested and working here. Thanks for this patch - I arrived at the same fix before I found it.

  • tomvv committed 64baa11 on 7.x-1.x authored by acrazyanimal
    Issue #2944185 by acrazyanimal: 7.x-1.x - Pass along the Azure refresh...
tomvv’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.