Add roles to the access token

Thanks Marcus
I know this article and i did try to implement that code , it doesnt work for me.
could it have anything to do with the fact that i use the Resource Owner Password api to get the access token ?
Thanks