Fixing Security Entity Provider tutorial

for more info see #2756
squashed commits from pull request #2753

(based on what i found, the only way how to squash commits in pull request on github is to create another pull request)