Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#174823724] Add token name to GetUser from Azure ADB2C #84

Merged
merged 2 commits into from
Sep 18, 2020

Conversation

AleDore
Copy link
Contributor

@AleDore AleDore commented Sep 18, 2020

This PR is useful to retrieve custom extension property token_name from Azure AD B2C, while calling GetUser API. Property value is also mapped into UserInfo API model in order to make possible info's propagation to io-functions-services.

@pagopa-github-bot
Copy link
Contributor

pagopa-github-bot commented Sep 18, 2020

Affected stories

  • 🌟 #174823724: Come CIT vorrei impedire ai servizi non autorizzati di usare la mia utenza per impersonificarmi su altre piattaforme

Generated by 🚫 dangerJS

@codecov-commenter
Copy link

codecov-commenter commented Sep 18, 2020

Codecov Report

Merging #84 into master will decrease coverage by 1.58%.
The diff coverage is 81.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #84      +/-   ##
==========================================
- Coverage   86.62%   85.04%   -1.59%     
==========================================
  Files          39       41       +2     
  Lines        1249     1371     +122     
  Branches       88      114      +26     
==========================================
+ Hits         1082     1166      +84     
- Misses        166      200      +34     
- Partials        1        5       +4     
Impacted Files Coverage Δ
DeleteUserDataActivity/utils.ts 34.21% <50.00%> (ø)
utils/conversions.ts 81.81% <58.33%> (-6.82%) ⬇️
GetUser/handler.ts 90.27% <66.66%> (-1.91%) ⬇️
ExtractUserDataActivity/handler.ts 77.30% <70.96%> (-0.71%) ⬇️
DeleteUserDataActivity/backupAndDelete.ts 92.85% <87.09%> (ø)
GetServices/handler.ts 84.84% <94.73%> (-0.34%) ⬇️
CreateService/handler.ts 85.18% <100.00%> (ø)
CreateUser/handler.ts 86.84% <100.00%> (-1.80%) ⬇️
GetService/handler.ts 86.95% <100.00%> (ø)
GetUserDataProcessingActivity/handler.ts 90.90% <100.00%> (-0.21%) ⬇️
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6885fcc...3186c15. Read the comment docs.

Comment on lines +220 to +221
adb2User[
`adb2User.extension_${adb2cCredentials.clientId}_token_name`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if the user does not have this attribute ? (may you try to delete ti into the ADB2C and call GetUser?)

Copy link
Contributor Author

@AleDore AleDore Sep 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that many users will not have this attribute on ADB2C. In that case token_name should be null and it will remain null until we add it on Active Directory. Why should we delete the user if it does not have token_name?

@gunzip gunzip merged commit 419bc30 into master Sep 18, 2020
@gunzip gunzip deleted the 174823724_get_token_name_from_azure_AD branch September 18, 2020 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants