oracle/weblogic-azure

AAD integration script unable to parse space based STDIN arguments and parameters position issue

Opened this issue · 4 comments

  • AAD integration script fails in parsing space based arguments like adPrincipal, adUserBaseDN and adGroupBaseDN when it is passed via STDIN
  • adUserBaseDN and adGroupBaseDN arguments were wrongly accpted at shell script from ARM template. Value of adUserBaseDN is received by adGroupBaseDN and value adGroupBaseDN is by adUserBaseDN

AAD nested template is accepting parameters like below

"const_aadParameters": "[concat(parameters('wlsUserName'),' ',parameters('wlsPassword'),' ',parameters('wlsDomainName'),' ',parameters('wlsLDAPProviderName'), ' ', parameters('aadsServerHost'), ' ', parameters('aadsPortNumber'), ' ', concat('"',parameters('wlsLDAPPrincipal'),'"'), ' ', parameters('wlsLDAPPrincipalPassword'), ' ', concat('"',parameters('wlsLDAPUserBaseDN'),'"'), ' ', concat('"',parameters('wlsLDAPGroupBaseDN'),'"'), ' ', variables('const_wlsHome'),' ',parameters('adminVMName'),' ',variables('const_wlsAdminPort'),' ',parameters('wlsLDAPSSLCertificate'), ' ', parameters('aadsPublicIP'), ' ', variables('const_adminServerName'), ' ', variables('const_wlsDomainPath'),' ',parameters('enableCustomSSL'),' ',base64(parameters('keyVaultCustomTrustKeyStorePassPhrase')),'',base64(parameters('keyVaultCustomTrustKeyStoreType')))]"

Now it is modified with
"const_aadParameters": "[concat(parameters('wlsUserName'),' ',parameters('wlsPassword'),' ',parameters('wlsDomainName'),' ',parameters('wlsLDAPProviderName'), ' ', parameters('aadsServerHost'), ' ', parameters('aadsPortNumber'), ' ', base64(parameters('wlsLDAPPrincipal')), ' ', parameters('wlsLDAPPrincipalPassword'),' ', base64(parameters('wlsLDAPUserBaseDN')),' ', base64(parameters('wlsLDAPGroupBaseDN')),' ', variables('const_wlsHome'),' ',parameters('adminVMName'),' ',variables('const_wlsAdminPort'),' ',parameters('wlsLDAPSSLCertificate'),' ', parameters('aadsPublicIP'),' ',variables('const_adminServerName'),' ', variables('const_wlsDomainPath'),' ',parameters('enableCustomSSL'),' ',base64(parameters('keyVaultCustomTrustKeyStorePassPhrase')),' ',base64(parameters('keyVaultCustomTrustKeyStoreType')))]",

At shell script arguments are changed from
read wlsUserName wlsPassword wlsDomainName adProviderName adServerHost adServerPort adPrincipal adPassword adGroupBaseDN adUserBaseDN oracleHome wlsAdminHost wlsAdminPort wlsADSSLCer wlsLDAPPublicIP wlsAdminServerName wlsDomainPath isCustomSSLEnabled customTrustKeyStorePassPhrase customTrustKeyStoreType

Now position of parameters adUserBaseDN and adGroupBaseDN is changed as per ARM template passing.
read wlsUserName wlsPassword wlsDomainName adProviderName adServerHost adServerPort adPrincipal adPassword adUserBaseDN adGroupBaseDN oracleHome wlsAdminHost wlsAdminPort wlsADSSLCer wlsLDAPPublicIP wlsAdminServerName wlsDomainPath isCustomSSLEnabled customTrustKeyStorePassPhrase customTrustKeyStoreType

@sanjaymantoor I am glad to see this is under control. I look forward to reviewing the PR.

Created PR #187 . Refer 813b3c3