getMail() method is returning the email alias instead of real email address
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Stack de tecnologia
- java
- Domínio
- api, authentication
Direção de pesquisa
Comece com getUserProfile e a chamada graphClient.me().get(), depois inspecione como User.getMail() mapeia a resposta do perfil do Microsoft Graph. Compare o comportamento relatado do alias e do endereço real com os scopes listados e o comportamento atual do SDK. Considera-se concluído quando a consulta do perfil retorna o endereço esperado ou documenta claramente a limitação da API, com um teste de regressão se o SDK controlar o mapeamento.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Describe the bug
I'm using the SDK in order to allow the user to get authenticated on my platform.
The problem that I'm facing is that the getMail() is returning the email alias instead of the real email. For example:
- user get authenticated using the account danielrealuser@gmail.com;
- the user get authenticated, however, the real email address is randomvalue@outlook.com;
- instead or returning randomvalue@outlook.com it returns danielrealuser@gmail.com.
Expected behavior
When requesting the data regarding the user, it should return the real user email in the property getMail, however, it gets the alias used to authenticate on Outlook.
How to reproduce
These are the scopes that I'm using (and I'll user more later not related to this topic):
"email",
"Mail.Read",
"Mail.Read.Shared",
"Mail.ReadBasic",
"Mail.ReadBasic.Shared",
"offline_access",
"openid",
"profile",
"User.Read.all",
"User.ReadBasic.All",
"ExternalUserProfile.Read.All"
Code implementation
public User getUserProfile(String accessToken) {
GraphServiceClient graphClient = createGraphServiceClient(accessToken);
return graphClient.me().get();
}
IAuthenticationResult authResult = this.exchangeCodeForTokens(authCode);
User user = this.getUserProfile(authResult.accessToken());
// Get user profile using the access token
return new MicrosoftUserData(
user.getId(),
user.getGivenName(),
user.getSurname(),
user.getMail(),
authResult.accessToken(),
authResult.accessToken(), // Use refresh token instead of access token twice
user.getDisplayName(),
getProfilePictureDataUrl(authResult.accessToken())
);
SDK Version
No response
Latest version known to work for scenario above?
6.40.0
Known Workarounds
No response
Debug output
Click to expand log
```</details>
### Configuration
_No response_
### Other information
_No response_
- Linguagem predominante
- Java
- Estrelas
- 444
- Forks
- 154
- Merge médio
- 18h 28min
- PRs com merge (30d)
- 4
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de microsoftgraph/msgraph-sdk-java
-
status:waiting-for-triage type:bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
microsoftgraph/msgraph-sdk-java#2610 ·
-
status:waiting-for-triage type:bug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 55/100
microsoftgraph/msgraph-sdk-java#2656 ·
-
status:waiting-for-triage type:bug
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 38/100
microsoftgraph/msgraph-sdk-java#2654 ·
-
status:waiting-for-triage
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
microsoftgraph/msgraph-sdk-java#2639 ·
-
Error in PATCH onlineMeeting Abertastatus:waiting-for-triage type:bug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 35/100
microsoftgraph/msgraph-sdk-java#2589 · 1 comentário ·
Todas as issues de microsoftgraph/msgraph-sdk-java
Issues semelhantes
-
Bug Java Platform: Java
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
getsentry/sentry-java#6138 · 1 comentário ·
-
bug needs triage p2
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
GoogleCloudPlatform/DataflowTemplates#4273 · 1 comentário ·
-
[Studio][Bug] Bulk-deleting a full page of alert rules steps the page back while more rules remain Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
apache/rocketmq-dashboard#4654 · 1 comentário ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100