Authenticating using ConfidentialClient
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 15/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Ambito
- authentication
Direzione di ricerca
Inizia verificando se questa domanda sull'autenticazione .NET appartiene al repository msgraph-sdk-java, quindi esamina la funzione GetAppAuthentication segnalata e il link sulla disponibilità di ConfidentialClientApplicationBuilder. Il lavoro è completato quando viene identificato il motivo per cui gli scenari Windows Service e WinForms ricevono questo errore e viene documentato o confermato un approccio supportato; non vengono indicati file di progetto né test.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hello,
Some of our customers are unable to send out automated emails because support for basic authentication with SMTP is being removed.
I am looking at finding a solution and it seems the Graph API is the recommended approach.
I have manage to create a working example using PublicClientApplicationBuilder however, this class displays a pop-up requiring the user to sign in, since we have automated services with no user interaction, this is not a good solution.
I have seen some examples using ConfidentialClientApplicationBuilder and this seems idea.
However, I have reached multiple dead-ends and everytime receive the error:
Confidential Client flows are not available on mobile platforms or on Mac.See https://aka.ms/msal-net-confidential-availability for details.
I understand that it is limeted by design (see issues/742) but ConfidentialClientApplicationBuilder throws this issue for every project type I try, WinForm, Windows Service, Console app.
I have got it working on a ASP controller but they is not practicable for our customer.
I am storing my Client, Tenant and Secret in a database table and here is my code:
Private Async Function GetAppAuthentication() As Task(Of AuthenticationResult)
Dim folderAccess = BLL.L2S.SystemApplicationGateway.GetFolderAccess(mBLL_SY.ReadonlyDbContext)
If folderAccess Is Nothing Then
Return Nothing
End If
Dim app = ConfidentialClientApplicationBuilder.Create(folderAccess.Client) _
.WithClientSecret(folderAccess.Secret) _
.WithTenantId(folderAccess.Tenant) _
.Build()
Dim scopes As String() = {"https://outlook.office365.com/.default"}
Dim result As AuthenticationResult = Await app.AcquireTokenForClient(scopes).ExecuteAsync()
Return result
End Function
I am using .Net Framework 4.7.2, we have Windows Services and WinForms apps and both need to send out emails.
The error message is very confusing to me because of course it is not a mobile app, and I have even created a UnitTest that seemingly works fine which again is very confusing to me.
This is urgent as this is already causing issues for our customers.
Thanks in advance.
- Lingua principale
- Java
- Stelle
- 444
- Fork
- 154
- Merge medio
- 18h 28m
- PR unite (30g)
- 4
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoftgraph/msgraph-sdk-java
-
status:waiting-for-triage type:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
microsoftgraph/msgraph-sdk-java#2610 ·
-
status:waiting-for-triage type:bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
microsoftgraph/msgraph-sdk-java#2656 ·
-
status:waiting-for-triage type:bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
microsoftgraph/msgraph-sdk-java#2654 ·
-
status:waiting-for-triage
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
microsoftgraph/msgraph-sdk-java#2639 ·
-
Error in PATCH onlineMeeting Apertastatus:waiting-for-triage type:bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
microsoftgraph/msgraph-sdk-java#2589 · 1 commento ·
Tutte le issue di microsoftgraph/msgraph-sdk-java
Issue simili
-
bug untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
opensearch-project/ml-commons#5094 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
-
emitter:client:csharp feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
affects/8.10 affects/8.9 component/clients kind/bug likelihood/mid severity/mid
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Two open-case totals on one screen: the Programs tile says 15,858 and the nav badge says 15,868 Apertabug frontend maui-pilot
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100