【Site Setup】Users: Change password on next logon

# Introduction #
I am trying to see how **Change password on next logon** property in Sharperlight `Site Setup` works with this post.

:::note warn
This is for Sharperlight Web channel and works with Sharperlight users only, and not for Windows Domain user and other synced users such as LDAP.  

:::
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/2c8c23c1-bb7e-5f62-cc6e-c889376201ca.png)

# Practices #
The Sharperlight user: **User 1** has a password `user1`, and the Sharperlight user: **User 2** has a password `user2.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/8632fb84-7793-3365-7644-4beed8a8df5a.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/d38fe006-4098-1e0e-d7c8-a020850d7218.png)

Then the service property: **Allow User Password Change** in Sharperlight Client Setup is **False**.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/4cd85277-326e-aec9-163e-7d3bc9e06e97.png)

Let's check the settings with the web channel.
Go for Sharperlight index page with `http:\\{{the pc name}}\mdService1Rest\Index`.
This page is displayed because my Windows account is registered with Sharperlight, so it appears without any interference.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/ec19ce94-7848-54b1-e690-bf1bec0ccd34.png)

Logout from the page by clicking the user icon.
Then this login screen is displayed.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/36637120-d3b2-a592-2c15-d07fd335cedf.png)
Set **User1** as user name and **user1** as its password, and click `Sign In`.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/53b282d7-5c28-f5ae-6db9-b935e7119d29.png)
I can log directly into this page with the user.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/9c0f68cf-7385-2afe-4ee6-9a1c7276a124.png)

Now set **True** for **Change password on next logon** property of **User1**.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/01cac287-316c-f216-9d67-216193fe533d.png)
Go back to the index page, and logout from it.
"As soon as I click the `Sign In` button with the login details, the `Enter new password` section is displayed because I set the **Change password on next logon** property to **True**.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/b2bc4bdd-8be3-517b-11e5-f5bf36672260.png)

Fill in all text fields and click OK to apply the change.
However, this message: `Password Change option is off in Client Setup on Server` is displaied and the change is not applied.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/81b59f14-e12e-ff11-ddb4-b129638a80a3.png)

To avoid this interference, I can set **True** for the service property: **Allow User Password Change** in the Sharperlight Client Setup.
Let's go for Client Setup and set **True** for the property.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/6a90bad9-58c4-508a-19b2-9bf8cb4c463a.png)
Click OK to save the change, and restart the Sharperlight Service.
Go back to the Index page.
Sign in with User1, and it will force you to change the password.
Set the new password and Click `Apply`.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/cb358fbf-9668-fe93-6a9f-3143ce1ac5a3.png)

This time, the change is applied without any interference.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/522068af-0aea-0b6e-0a2f-124c4add6afc.png)
Now I can login with the new password.

When the service property: **Allow User Password Change** in the Sharperlight Client Setup is set to **True**, the gear icon is displayed, allowing all `Sharperlight users` to change their passwords.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/32bc8138-7cb8-4aa4-556e-3d5372d069ac.png)

When I log in with User2, who is a `Sharperlight user`, I can change the password by clicking the gear icon.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/b583200c-db25-6375-7408-40af6555f33f.png)

However, with a ``Windows Domain user``, the option cannot force the change.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/c4cf4316-fc74-7edd-3c5c-7e2afe09df87.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/13e57ceb-ccab-320a-59f4-cb5548c6e3da.png)

# Afterword #
After changing the password with the option: **Change password on next logon**, the option is set back to **False**, and the user's password is overwritten with the new password.

The user option: **Change password on next logon** and the service option: **Allow User Password Change** work for `Sharperlight users` only.

I hope this helps with your work.