Showing posts with label books. Show all posts
Showing posts with label books. Show all posts

Wednesday, March 28, 2012

Login failed for user 18456 when using asymmetric key for login

Hi,

I wanted to check the asymmetric key option in sql 2005. I copied the books online code for creating a asymmetric key and then used this key for creating a login. Now when I try to login without entering any password I am receiving 18456 error. I would like to know what I am missing here. If I use CREATE LOGIN from asymmetric key or certificate how do I login and with what credentials. Do I need to provide any password.

CREATE ASYMMETRIC KEY PacificSales09 WITH ALGORITHM = RSA_2048 ENCRYPTION BY PASSWORD = 'bmsA$dk7i82bv55foajsd9764'; GO

CREATE LOGIN asm FROM ASYMMETRIC KEY PacificSales09;

Regards,

Ravi

After Creating a login you will have to give explicit permissions of connectivity and other things to the login, was that done?|||

Hi,

Thanks for the response. Yes I did create a user for the login and put in the reader/writer role. So that was not the issue here.

Even if I do not grant these permissions by default it should still have permissions that a Guest login would have so I would still be able to get connected to the server. Same stuff works for other logins I have the problem only when I create a login from certificate and asymmetric key sources.

I think I do not have to supply a password for my login when I create it using certificate and asymmetric key sources.

I still do not understand how do I use a login created from these sources and what difference does it make from a normal login.

Regards,

Ravi

|||

Logins mapped to certificates or asymmetric keys cannot be used for authentication with SQL Server - you cannot login with them. These logins are used to assign server-level permissions to the certificates/asymmetric keys that are mapped to them, which is useful for signing; that is their sole purpose. For an example of use, see the following example:

http://blogs.msdn.com/lcris/archive/2005/06/15/429631.aspx

Thanks
Laurentiu

|||

Thanks a lot. It helped me in understanding their usage.

Regards,

Ravi

Login failed for user 18456 when using asymmetric key for login

Hi,

I wanted to check the asymmetric key option in sql 2005. I copied the books online code for creating a asymmetric key and then used this key for creating a login. Now when I try to login without entering any password I am receiving 18456 error. I would like to know what I am missing here. If I use CREATE LOGIN from asymmetric key or certificate how do I login and with what credentials. Do I need to provide any password.

CREATE ASYMMETRIC KEY PacificSales09 WITH ALGORITHM = RSA_2048 ENCRYPTION BY PASSWORD = 'bmsA$dk7i82bv55foajsd9764'; GO

CREATE LOGIN asm FROM ASYMMETRIC KEY PacificSales09;

Regards,

Ravi

After Creating a login you will have to give explicit permissions of connectivity and other things to the login, was that done?|||

Hi,

Thanks for the response. Yes I did create a user for the login and put in the reader/writer role. So that was not the issue here.

Even if I do not grant these permissions by default it should still have permissions that a Guest login would have so I would still be able to get connected to the server. Same stuff works for other logins I have the problem only when I create a login from certificate and asymmetric key sources.

I think I do not have to supply a password for my login when I create it using certificate and asymmetric key sources.

I still do not understand how do I use a login created from these sources and what difference does it make from a normal login.

Regards,

Ravi

|||

Logins mapped to certificates or asymmetric keys cannot be used for authentication with SQL Server - you cannot login with them. These logins are used to assign server-level permissions to the certificates/asymmetric keys that are mapped to them, which is useful for signing; that is their sole purpose. For an example of use, see the following example:

http://blogs.msdn.com/lcris/archive/2005/06/15/429631.aspx

Thanks
Laurentiu

|||

Thanks a lot. It helped me in understanding their usage.

Regards,

Ravi