Closed nblumhardt closed 5 years ago
API keys have been extended in v5 to accommodate this.
I am trying to get this working, but having no luck. I've tried both passing an Azure AD access token as the apiKey
parameter to SeqConnection
and setting HttpClient.DefaultRequestHeaders.Add("Authorization", "Bearer <token>")
, but I always get a "401 - Please log in." response. Can you give any hints?
Hi! To use API keys here, you need to log into Seq with your AAD credentials and create an API key for SeqConnection
to use (either a personal key, from your user preferences, or a system key, from Settings > API keys).
Let me know if this helps :+1:
Got it! I thought you had meant an Azure AD access token could be used to authenticate with the API directly, but I get it now. (That would be useful because it would allow zero-configuration CLI client authentication on Windows PCs via integrated authentication, but I can live without it.) Thanks!
The API client can log in or access Seq using API keys, username/password authentication, or Windows integrated authentication. We should investigate logging in through Azure Active Directory to complete this.
https://azure.microsoft.com/en-us/resources/samples/active-directory-dotnet-native-headless/
An additional library may be needed, in order to avoid an ADAL dependency from the core client package.