Access Denied error in WSO2 remote instance connection on G-Reg registry (4.1) - esb

I created an ESB service and tried to load remote instance from G-Reg registry. My ESB and G-Reg use same MySQL DB, JVM, OS.
And then two error log messages have been printed in my console:
(1)ERROR - RegistryAdminServiceClient Error occurred while checking registry mode
(2)org.apache.axis2.AxisFault: Access Denied. Please login first.
What does "Please login first" & "checking registry mode" mean? Where should I login? What is registry mode?

This exception normally occurs when you are logged out from server backend. Checking Registry mode means it tries to check if the Registry is read only or not.

Related

ODBC - Integrated Windows Authentication is not working as expected in AWS Workspace via IIB (IBM Integration Bus)

I am trying to connect to a SQL server with windows authentication using ODBC. Created a DSN and the connectivity is fine. But when I try to access the DSN via IIB (IBM Integration Bus), getting the following error:
[Microsoft][SQL Server Native Client 11.0][SQL Server]Login failed for user '<DOAMIN>\<AWS_HOST_NAME>'.
IIB is picking up the AWS Host Name instead of the Windows username for authentication.
enter image description here
I have resolved this issue by providing the Windows username and password in the Log on section of IIB services.
Steps to follow:
Run -> services.msc
IIB Services -> Properties
Log on -> This account -> Provide Windows username and password.

SQLException when deploying ASP.NET Boilerplate application to Azure

I've been trying to deploy an ASP.NET Boilerplate application to Azure for the last couple of days and I haven't been able to do so. I keep stumbling upon this error:
First I make a Web App + SQL resource and then publish my project to it from inside Visual Studio using the right click -> deploy option, and then importing the publication profile I got from Azure. I make sure the database connection string in the appsettings.production.json are correct but I can't seem to connect to the database. If I try to connect to the database through the SQL Server Management Studio I get a similar error. This means something is wrong with the database itself.
Do I need to create a separate SQL database in Azure that makes use of the SQL database server that comes with the Web App + MySQL resource?
Any help would be greatly appreciated! I have been spending way too much time on this problem already.
This is a screenshot of all the resources in the Azure portal, these were created while creating the Web app + MySQL resource:
Edit: This is the error I am getting:
Win32Exception: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. Unknown location SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.) Microsoft.Data.ProviderBase.DbConnectionPool.CheckPoolBlockingPeriod(Exception e) InvalidOperationException: An exception has been raised that is likely due to a transient failure. Consider enabling transient error resiliency by adding 'EnableRetryOnFailure()' to the 'UseSqlServer' call. Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute<TState, TResult>(TState state, Func<DbContext, TState, TResult> operation, Func<DbContext, TState, ExecutionResult<TResult>> verifySucceeded) Win32Exception: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Since you mentioned you can't access db in any other way, I provided step-by-step instruction
You can get your connection string from Azure resource panel
Navigate to Connection security tab and enable access from other Azure resources. This way WebApp will be able access database server inside Azure network. I also added my client IP to test db connection from my PC later. Click Save at the top when you are done
On the same page there is setting called configure SSL connection. Certificate can be downloaded from https://learn.microsoft.com/uk-ua/azure/mysql/howto-configure-ssl. I used this file https://www.digicert.com/CACerts/BaltimoreCyberTrustRoot.crt.pem . Optionally, you could disable this feature for now.
Now we have everything to test db connection. I will show it with the use of HeidiSQL client.
Click open and see your databases
According to this you need to have CACertificateFile parameter appended to connection string to use SSL, so you need to put file into repository and provide its relative path in connection string
This was all caused by a stupid mistake, in the Azure portal I selected the Web App + MySQL resource instead of the Web App + SQL resource. For the ASP.NET Boilerplate project I am using you need a Web App + SQL resource.

Azure MySQL Azure Active Directory Access Token

I got MySql Server on Azure and is configured with Azure Directory Admin.
Example
MySql Servername: mysqlserver and
MySql AD Admin Account: admin#organistionname.com.au (this organisation domain account)
Can see above account from MySql Server under User Accounts.
I stood-up Azure Web App for phpMyadmin and configured to pointed to above MySql db.
When an logging into phpMyAdmin with above Active Directory Admin Account is getting validated against AD, but getting error
mysqli::real_connect(): (HY000/9013): An error occurred while validating the access token. Please acquire a new token and retry.
I need to get a Ad token which need to passed to MySql server.
How to achieve this in Azure Web App?
This documentation should help you: https://learn.microsoft.com/en-gb/azure/mysql/howto-configure-sign-in-azure-ad-authentication#connecting-to-azure-database-for-mysql-using-azure-ad.
You need to acquire an access token in your code for your user against the resource: https://ossrdbms-aad.database.windows.net or against the scope (if using v2): https://ossrdbms-aad.database.windows.net/.default.
Acquiring access tokens with AAD is a whole another topic and the exact way depends on your app.
This answer might help for that: https://stackoverflow.com/a/33512913/1658906
I have the same set up (except phpmyadmin running in a container in AKS).
I believe phpmyadmin can't connect to mysql with azure ad enabled (at least with an AD user/group) because the token (password) is required to be sent in cleartext, and phpmyadmin hashes it before sending it.
I think that's why I get the An error occurred while validating the access token. Please acquire a new token and retry. error.
That's also why in the docs, they set the --enable-cleartext-plugin flag on their example mysql cli commands.
Also in the docs, they state that it's only tested with myqsl cli and mysqladmin.
I'm currently planning on ditching phpmyadmin for azure bastion and a VM running mysqlworkbench for this reason.

Server requires auth switch, but no auth switch handler provided

I'm using node-mysql2 and receiving this error message when connecting to a production instance of mysql via a wan:
Server requires auth switch, but no auth switch handler provided
This error is not received when connecting to our local dev server.
Furthmore, connecting to this mysql instance by other means works fine (mysql cli, Toad)
node-mysql2 version: mysql2#1.1.2 installed via npm.
This error was allegedly fixed back in Aug (RC9) https://github.com/sidorares/node-mysql2/pull/331
I'm not very familiar with mysql, Is there a server setting we can change to workaround this issue?
So it turns out this error also occurs with other libraries which give more meaningful error messages, e.g.: Authentication with old password no longer supported, use 4.1 style passwords
Solution from here: https://forums.mysql.com/read.php?38,593423,593423
SET SESSION old_passwords=0;
SET PASSWORD=PASSWORD('YOURDATABASEPASSWORD');

Credential IIS to SQL Server (trusted Connection ?)

I have one physical server. On this server one VMWare running "SQL Server 2008R2", an another VMWare runnning "IIS 7" on Windows 2008R2
When I try to join the web site from the virtual machine where IIS is running or from another client on the network, I receive this error :
"401 Unauthorized : Access is denied due to invalid credentials", my user is know in the users of the database.
Any idea ?
Thanks,
Can you verify your application's pool identity? By default it doesn't use "network services".
I suppose that your connection string is set to "Integrated Security=True".
Gtz,
Stéphane.
There seems to be a problem at IIS level rather than SQL Server authentication issue. Is your web site running under "Integrated Windows" mode (NTLM/Kerberos)? You could try to switch to "Anonymous Authentication" instead:
Open IIS Manager and select the website that is causing the error (I assume it's Default Web Site).
Open the "Authentication" property under the "IIS".
Enable "Anonymous Authentication" item and disable others.