diff options
author | Thomas Citharel <tcit@tcit.fr> | 2017-04-30 09:16:55 +0200 |
---|---|---|
committer | Thomas Citharel <tcit@tcit.fr> | 2017-06-14 17:53:52 +0200 |
commit | 0f8268c93e6210d368f9dcd1900274871a9eacdf (patch) | |
tree | 251024ae114d2a14a67399ba28d02ddb6d031bad /app/Resources | |
parent | f93a3109a5f0999dbbd69131c9e5041c390120c9 (diff) | |
download | wallabag-0f8268c93e6210d368f9dcd1900274871a9eacdf.tar.gz wallabag-0f8268c93e6210d368f9dcd1900274871a9eacdf.tar.zst wallabag-0f8268c93e6210d368f9dcd1900274871a9eacdf.zip |
Add client_credentials as grant_typeoauth-changes
Therefore, username and password are no longer needed
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Allow to have global clients, auth through direct token or auth code and bring scopes
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
fix review
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
remove redirect uri requirement on specific clients
add back password and depreciate it
enforce state
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Allow apps to register themselves
A handful of changes
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
change timeout values
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
set access_token lifetime to 1 year and double for refresh_token
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Diffstat (limited to 'app/Resources')
4 files changed, 93 insertions, 0 deletions
diff --git a/app/Resources/FOSOAuthServerBundle/views/Authorize/authorize.html.twig b/app/Resources/FOSOAuthServerBundle/views/Authorize/authorize.html.twig new file mode 100644 index 00000000..42566a05 --- /dev/null +++ b/app/Resources/FOSOAuthServerBundle/views/Authorize/authorize.html.twig | |||
@@ -0,0 +1,7 @@ | |||
1 | {% extends "WallabagCoreBundle::layout.html.twig" %} | ||
2 | |||
3 | {% block title %}{{ 'developer.client.page_title'|trans }}{% endblock %} | ||
4 | |||
5 | {% block content %} | ||
6 | {% include "FOSOAuthServerBundle:Authorize:authorize_content.html.twig" %} | ||
7 | {% endblock content %} | ||
diff --git a/app/Resources/FOSOAuthServerBundle/views/Authorize/authorize_content.html.twig b/app/Resources/FOSOAuthServerBundle/views/Authorize/authorize_content.html.twig new file mode 100644 index 00000000..d7f2dbe0 --- /dev/null +++ b/app/Resources/FOSOAuthServerBundle/views/Authorize/authorize_content.html.twig | |||
@@ -0,0 +1,53 @@ | |||
1 | <div class="row"> | ||
2 | <div class="col s12"> | ||
3 | <h4>A new application would like to connect to your account</h4> | ||
4 | |||
5 | <div class="center-align col l6 offset-l3"> | ||
6 | <div class="row"> | ||
7 | <ul class="collection"> | ||
8 | <li class="collection-item avatar"> | ||
9 | {% if client.image %} | ||
10 | <img src="{{ client.image }}" alt="Client icon" class="circle"> | ||
11 | {% endif %} | ||
12 | <span class="title">{{ client.name }}</span> | ||
13 | <p>{{ client.description }}</p> | ||
14 | </li> | ||
15 | </ul> | ||
16 | {% set scopes = form.scope.vars.value | split(' ') %} | ||
17 | {# TODO : Fix me when https://github.com/FriendsOfSymfony/FOSOAuthServerBundle/issues/309 is ok #} | ||
18 | <ul class="collapsible col s12 m12 l6 offset-l3" data-collapsible="accordion"> | ||
19 | {% for scope in scopes %} | ||
20 | {% if scope == 'read' %} | ||
21 | <li> | ||
22 | <div class="collapsible-header"><i class="material-icons">visibility</i>Read Permission</div> | ||
23 | <div class="collapsible-body"><span>{{ client.name }} will be able to access the list and contents of your entries, tags and annotations.</span></div> | ||
24 | </li> | ||
25 | {% endif %} | ||
26 | {% if scope == 'write' %} | ||
27 | <li> | ||
28 | <div class="collapsible-header"><i class="material-icons">edit</i>Edit Permission</div> | ||
29 | <div class="collapsible-body"><span>{{ client.name }} will be able to edit and manage (including deleting) your entries, tags and annotations.</span></div> | ||
30 | </li> | ||
31 | {% endif %} | ||
32 | {% if scope == 'user' %} | ||
33 | <li> | ||
34 | <div class="collapsible-header"><i class="material-icons">person</i>User Permission</div> | ||
35 | <div class="collapsible-body"><span>{{ client.name }} will be able to manage your user account.</span></div> | ||
36 | </li> | ||
37 | {% endif %} | ||
38 | {% endfor %} | ||
39 | </ul> | ||
40 | </div> | ||
41 | {{ form_start(form, {'method': 'POST', 'action': path('fos_oauth_server_authorize'), 'label_attr': {'class': 'fos_oauth_server_authorize'} }) }} | ||
42 | <input class="waves-effect waves-light btn red" type="submit" name="rejected" value="{{ 'authorize.reject'|trans({}, 'FOSOAuthServerBundle') }}" /> | ||
43 | <input class="waves-effect waves-light btn" type="submit" name="accepted" value="{{ 'authorize.accept'|trans({}, 'FOSOAuthServerBundle') }}" /> | ||
44 | {{ form_row(form.client_id) }} | ||
45 | {{ form_row(form.response_type) }} | ||
46 | {{ form_row(form.redirect_uri) }} | ||
47 | {{ form_row(form.state) }} | ||
48 | {{ form_row(form.scope) }} | ||
49 | {{ form_rest(form) }} | ||
50 | </form> | ||
51 | </div> | ||
52 | </div> | ||
53 | </div> | ||
diff --git a/app/Resources/static/themes/material/css/various.scss b/app/Resources/static/themes/material/css/various.scss index 7daf40ec..5ff18038 100644 --- a/app/Resources/static/themes/material/css/various.scss +++ b/app/Resources/static/themes/material/css/various.scss | |||
@@ -30,3 +30,30 @@ nav .input-field input { | |||
30 | .tab { | 30 | .tab { |
31 | flex: 1; | 31 | flex: 1; |
32 | } | 32 | } |
33 | |||
34 | .slider .slides { | ||
35 | background: #00acc1; | ||
36 | |||
37 | li { | ||
38 | img { | ||
39 | background: no-repeat; | ||
40 | background-size: contain; | ||
41 | background-position: unset; | ||
42 | } | ||
43 | |||
44 | .icon { | ||
45 | width: auto; | ||
46 | height: 180px; | ||
47 | } | ||
48 | |||
49 | .icon.browser { | ||
50 | width: auto; | ||
51 | height: 100px; | ||
52 | } | ||
53 | |||
54 | .caption { | ||
55 | width: 85%; | ||
56 | left: 10%; | ||
57 | } | ||
58 | } | ||
59 | } | ||
diff --git a/app/Resources/static/themes/material/index.js b/app/Resources/static/themes/material/index.js index d6afbb8a..74f64f9e 100755 --- a/app/Resources/static/themes/material/index.js +++ b/app/Resources/static/themes/material/index.js | |||
@@ -75,4 +75,10 @@ $(document).ready(() => { | |||
75 | const scrollPercent = (s / (d - c)) * 100; | 75 | const scrollPercent = (s / (d - c)) * 100; |
76 | $('.progress .determinate').css('width', `${scrollPercent}%`); | 76 | $('.progress .determinate').css('width', `${scrollPercent}%`); |
77 | }); | 77 | }); |
78 | |||
79 | if ($('.slider')) { | ||
80 | $('.slider').slider({ | ||
81 | height: 500, | ||
82 | }); | ||
83 | } | ||
78 | }); | 84 | }); |