Created
February 9, 2018 22:57
-
-
Save bandrzejczak/0665c2ac2964db0df40b39c3b4fb98dd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def impersonate(username: String): Future[(String, Duration)] = { | |
for { | |
impersonatorToken <- obtainImpersonatorToken() | |
userId <- getUserId(username, impersonatorToken) | |
impersonatedUserCookies <- impersonateUser(impersonatorToken, userId) | |
userTokenAndTtl <- obtainTokenBasedOnIdentity(impersonatedUserCookies) | |
} yield userTokenAndTtl | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment