hougaard / BCCL_support

BCCL Support Repository
3 stars 0 forks source link

BCCL with windows authentication #18

Closed StefanMaron closed 1 year ago

StefanMaron commented 3 years ago

Describe the bug When trying to authenticate bccl to a bc instance with windows auth, I always get a 401 error. Not sure if this is supported or not?

Desktop (please complete the following information):

hougaard commented 3 years ago

Currently not tested. Honestly, we have not had many requests for that. We never use Windows authentication anywhere with BC, because, you know, cloud :)

I'll test it, thanks!

hougaard commented 3 years ago

Hmm... just installed a docker container running Windows authentication.

Verified in a browser that I indeed got the "windows authentication" login dialog as apposed to the basic auth dialog when hitting both the client and the webservice URL.

BCCL worked fine:

C:\projects\bccl\build\test>BCCL -w "http://bcwindows:7047/BC/WS/CRONUS International Ltd./Codeunit/bccl" -u BCWINDOWS\ERIK -p secretpassword -t tasks
{
  "Tasks": [
    {
      "Task": "DELETEALL",
      "Description": "Delete ALL Data from a table",
      "Codeunit": 80814,
      "Parameters": [
        "table",
        "view",
        "validate"
      ]
    },
    {
      "Task": "DELETEDATA",
      "Description": "Delete Data from a table",
      "Codeunit": 80811,
      "Parameters": [
        "table"
      ]
StefanMaron commented 3 years ago

hmm, I just created a new container but I still can not login.

Here my docker setup:

$containername = 'Test-dev'
$artifactUrl = Get-BCArtifactUrl -version 17.1 -select Latest -country de -type OnPrem

New-NavContainer -accept_eula:$accept_eula `
    -containername $containername `
    -auth Windows `
    -artifactUrl $artifactUrl `
    -updateHosts `
    -shortcuts DesktopFolder `
    -additionalParameters $additionalParameters `
    -memoryLimit 8G `
    -accept_outdated `
    -doNotCheckHealth `
    -doNotExportObjectsToText `
    -useBestContainerOS `
    -DeveloperServicesPort 7049 `
    -imagename myown `
    -enableTaskScheduler `
    -licenseFile "C:\GIT\BC17DEV.flf" 

image

Not sure what the problem is here. Are there logs which would be of any help?

hougaard commented 3 years ago

Quotes around the user name perhaps? Wonder if the dash in your domain is messing up the parameter. Try adding the --verbose parameter...

hougaard commented 3 years ago

here's my script, also using the -credential parameter....

$containerName = 'bcwindows'
$credential = Get-Credential -Message 'Using Windows authentication. Please enter your Windows credentials for the host computer.'
$auth = 'Windows'
$artifactUrl = Get-BcArtifactUrl -type 'OnPrem' -country 'w1' -select 'Latest'
$licenseFile = 'c:\navision\bc17.flf'
New-BcContainer `
    -accept_eula `
    -containerName $containerName `
    -credential $credential `
    -auth $auth `
    -artifactUrl $artifactUrl `
    -licenseFile $licenseFile `
    -updateHosts
StefanMaron commented 3 years ago

Does not help, I will try the latest version later and also to specify the credentials like you did

hougaard commented 3 years ago

What's your AD server?

StefanMaron commented 3 years ago

Not sure if I understand the question. I am currently on my work laptop, I think we have a azure AD

hougaard commented 3 years ago

And you're work laptop is part of your work AD? (Not Azure AD)

StefanMaron commented 3 years ago

yes, the laptop is in my work AD

hougaard commented 3 years ago

Can you access the WS URL from a browser?

StefanMaron commented 3 years ago

Yes this works without asking me again for credentials: image

hougaard commented 3 years ago

... but that's not with the "test-dev\stefan_" identity then? That's with your userid from your host machine....

StefanMaron commented 3 years ago

but that is because I can not add the work domain to the docker container. Test-dev is the container name. image

hougaard commented 3 years ago

I think, without the -credential option, your Windows SIDs are getting mixed up... having the to unconnected AD domains (your host, and the container) doing strange things.

I'm heading to bed now :)