Oauth error 'NoneType' object has no attribute 'split'

Hello,
I am trying to build and app with oauth but I have this error…
I have installed version 8
This is the url:

http://[URL]/api/method/frappe.integrations.oauth2.authorize?scope=all+openid&response_type=code&redirect_uri=http%3A%2F%2F127.0.0.1%3A8000&client_id=19ee6f84cb

when I use frappe.integrations.oauth2 it returns
You do not have enough permissions to complete the action

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 62, in application
response = frappe.api.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/api.py”, line 53, in handle
return frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 22, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 53, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 922, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/integrations/oauth2.py”, line 71, in authorize
scopes, frappe.flags.oauth_credentials = get_oauth_server().validate_authorization_request(uri, http_method, body, headers)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/oauthlib/oauth2/rfc6749/endpoints/base.py”, line 64, in wrapper
return f(endpoint, uri, *args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/oauthlib/oauth2/rfc6749/endpoints/authorization.py”, line 116, in validate_authorization_request
return response_type_handler.validate_authorization_request(request)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py”, line 303, in validate_authorization_request
request.client_id, request.redirect_uri, request):
File “/home/frappe/frappe-bench/apps/frappe/frappe/oauth.py”, line 84, in validate_redirect_uri
redirect_uris = frappe.db.get_value(“OAuth Client”, client_id, ‘redirect_uris’).split(get_url_delimiter())
AttributeError: ‘NoneType’ object has no attribute ‘split’

I followed this tuorial:

and this

but no success. Any idea why I have this error?

Check the following things,

OAuth Client Added

Frappe Server URL is in Social Login Keys Added

OAuth2Service must have right OAuth client data

In [1]: from rauth import OAuth2Service

In [2]: frappe_oauth_server = OAuth2Service(
   ...: 	client_id='99b11551b0',
   ...: 	client_secret='0f060f7898',
   ...: 	name='Test App',
   ...: 	authorize_url='http://192.168.0.108:8000/api/method/frappe.integrations.oauth2.authorize',
   ...: 	access_token_url='http://192.168.0.108:8000/api/method/frappe.integrations.oauth2.get_token',
   ...: 	base_url='http://192.168.0.108:8000/api/resource/'
   ...: )

In [3]: redirect_uri = "http://localhost"

In [4]: params = {'scope': 'openid all', 'response_type': 'code', 'redirect_uri': redirect_uri}

In [5]: url = frappe_oauth_server.get_authorize_url(**params) 

In [6]: url
Out[6]: u'http://192.168.0.108:8000/api/method/frappe.integrations.oauth2.authorize?scope=openid+all&redirect_uri=http%3A%2F%2Flocalhost&response_type=code&client_id=99b11551b0'

In [7]: data={'code': 'Wok9V0lkbo9chlWHOHj99j39fTV79p', 'grant_type':'authorization_code', 'redirect_uri': redirect_uri}

In [8]: import json

In [9]: session = frappe_oauth_server.get_auth_session(data=data,decoder=json.loads)

In [10]: print (session.get("ToDo", params={"fields":'["name","description"]'}).json())
{u'data': [{u'name': u'fb8691ac96', u'description': u'Test 1'}]}

Tried this right now on fresh new install, It is working.

@revant_one I did. Now I am having another error.