Stormpath cannot create google login groups

Established assault path and using Google login to register and login. Now I am trying to create groups in google directory in stormpath using this

from stormpath.client import Client
stormpath_client = Client(id=STORMPATH_CLIENT_APIKEY_ID, secret=STORMPATH_CLIENT_APIKEY_SECRET)
directory = stormpath_client.applications[0].account_store_mappings[1].account_store
directory.groups.create({'name': 'admins'})

based on this toturial

I get and error

Cannot create nor edit accounts of externally managed directories.

I get the same error if I try to create groups in the stormpath console.

enter image description here

How to give other users different permissions?

+4
source share
3 answers

I created a gist for sample code for this workaround stormpathinpython Flask

environment.py https://gist.github.com/ohadperry/f77a26ce758efa2990cb

authentication_controller.py https://gist.github.com/ohadperry/338e7e689d8c64158c06

stormpath_helper.py https://gist.github.com/ohadperry/50951e68f2375f0b9002

:

  • google.
  • , login

    from flask.ext.stormpath import User as StormpathUser
    from flask.ext.login import login_user 
    new_user_account.__class__ = StormpathUser
    # switching the session
    login_user(new_user_account, remember=True)
    
+2

Stormpath (, Google).

, Stormpath Directory ( ), , , ..

(), :

  • Google Stormpath.
  • Stormpath Directory /.
+2

Stormpath. , , - Stormpath.

PROCEDURE

  • Stormpath.

  • Applications .

  • Policies .

  • Account Linking Policy Status Enabled Automatic Provisioning Enabled.

  • !

, Social Login, Stormpath , . , . , ( , ) .

. .

0

Source: https://habr.com/ru/post/1625998/


All Articles