1
1
# Flask Yoti #
2
2
3
- Description
4
-
5
3
## Plugin configuration ##
6
4
### General settings ###
7
5
@@ -58,8 +56,8 @@ Example: `b14886f972d0c717`
58
56
### Endpoints configuration ###
59
57
60
58
` flask_yoti ` plugin provides some default endpoints:
61
- - ` yoti_auth ` (` /yoti/auth ` ) - is used for receiving token via callback and
62
- should'nt be changed
59
+ - ` yoti_auth ` (` /yoti/auth ` ) - is a callback used for receiving an
60
+ authentication token (shouldn't be changed)
63
61
- ` yoti_login ` (` /yoti/login ` ) - a view with just a login button. Can (and should)
64
62
be overridden by ` 'YOTI_LOGIN_VIEW' ` setting
65
63
- ` yoti_profile ` (` /yoti/profile ` ) - a view with user profile details. It's
@@ -82,7 +80,7 @@ app.config.update({
82
80
If * not* authenticated user is trying to access a view with
83
81
` @yoti_authenticated ` decorator, he/she will be redirected to this view.
84
82
Example: ` login ` <br >
85
- In case you have something like this in your Flask app:
83
+ In this case you should have something like this in your Flask app:
86
84
``` python
87
85
@app.route (' /login' )
88
86
def login ():
@@ -93,26 +91,27 @@ Default value: `flask_yoti.login` (with `/yoti/login/` URL)
93
91
* ** ` YOTI_REDIRECT_TO ` ** <br >
94
92
View name to which user is redirected after successful authentication.<br >
95
93
Example: ` profile ` <br >
96
- In case you have something like this in your Flask app::
94
+ In this case you should have something like this in your Flask app::
97
95
``` python
98
96
@app.route (' /profile' )
99
97
@yoti_authenticated
100
98
def login ():
101
99
user_profile = session.get(' yoti_user_profile' )
102
100
render_template(' profile.html' , ** user_profile)
103
101
```
104
- Default value: ` flask_yoti.profile ` (with ` /yoti/profile/ ` URL
102
+ Default value: ` flask_yoti.profile ` (with ` /yoti/profile/ ` URL)
105
103
106
104
<br >
107
105
108
106
109
107
### Yoti application configuration ###
110
108
111
109
Your Yoti application's callback URL should point to ` your_site.com/yoti/auth ` .<br >
112
- If you want to add a verification tag into any page (other than ` /yoti/auth/ ` ),
113
- you can use a ` {{ yoti_site_verification }} ` tag inside 'head' tag of that page.
110
+ If you want to add a verification tag into any template using Jinja2 or DTL as a
111
+ template language (other than ` /yoti/auth/ ` , because it's already has one),
112
+ you can use a ` {{ yoti_site_verification }} ` tag inside ` <head> ` of that template.
114
113
115
- ## Using plugin ##
114
+ ## Plugin usage ##
116
115
117
116
1 . First you need to add a login button to some of your view's templates.
118
117
- You can do it by using one of the predefined login buttons:
0 commit comments