Set Credentials programmatically [GOT CREATED]

It sounds similar to something which gets discussed here: