|
|
| The information in the article refers to |
Cognos
Cognos Access Manager - SDK
How do I change a user’s password in my ASP.Net application when I’m using Cognos Series 7 Security?
It turns out that it actually takes a very small amount of code. There is, not surprisingly, some set up required.
First, we have to add the COM object to Visual Studio. Then we have to create the connection to Access Manager. Lastly, we select the user object and change the password.
In order to add the COM object, all we do is install Access Manager on the web server and create the appropriate connection to the active name space. Then, right click on References and select "Add Reference." Select the COM tab and select "Authenticator2."
Now, we create the code to change the password:
Dim oAuthApp As Authenticator2.Application
oAuthApp = New Authenticator2.Application
'Log on as admin so the admin can change the user's password
Dim oAuthDoc = oAuthApp.Documents.OpenWithBasicSignon([namespace], [AdminUser],[AdminPwd], 0)
'get the Cognos user object
Dim oUsers = oAuthDoc.UserFolder.Users
'get the user object's sign on info
Dim oUserSignOn =Users.item([UserName]).IdentificationInformation.BasicSignons([UserName])
'set the new password
oUserSignOn.Password = [NewPassword]
We have now changed the user’s password. This method uses the Administrator’s log on to authenticate to the name space and then select the user and finally to change the user’s password. I have used this to allow users to change their own password through my custom ReportNet Application. I have also added a function to create a random password so I can use this code to reset the password to the new random password (to be e-mailed later.)
Have fun and good luck. Happy coding...
Have a question for our trainers?
Click here to send your questions!
|
|

To find out how we can help you solve your information challenges, visit our professional services pages:

|
|
|