Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-openid-auth
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
django-openid-auth
Commits
739309c5
Commit
739309c5
authored
May 28, 2007
by
swillison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
example is now example_consumer. next= parameter now actually works (thanks Jesse Legg)
parent
aef03dcd
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
23 additions
and
5 deletions
+23
-5
django_openidconsumer/templates/openid_signin.html
+1
-1
django_openidconsumer/views.py
+14
-3
example_consumer/__init__.py
+0
-0
example_consumer/manage.py
+0
-0
example_consumer/settings.py
+1
-1
example_consumer/urls.py
+1
-0
example_consumer/views.py
+6
-0
No files found.
django_openidconsumer/templates/openid_signin.html
View file @
739309c5
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<title>
Sign in with your OpenID
</title>
<title>
Sign in with your OpenID
</title>
<style
type=
"text/css"
>
<style
type=
"text/css"
>
input
.openid
{
input
.openid
{
background
:
url({{
action }}?logo=1
)
no-repeat
;
background
:
url({{
logo }}
)
no-repeat
;
background-position
:
0
50%
;
background-position
:
0
50%
;
padding-left
:
16px
;
padding-left
:
16px
;
}
}
...
...
django_openidconsumer/views.py
View file @
739309c5
...
@@ -3,7 +3,7 @@ from django.shortcuts import render_to_response as render
...
@@ -3,7 +3,7 @@ from django.shortcuts import render_to_response as render
from
django.template
import
RequestContext
from
django.template
import
RequestContext
from
django.conf
import
settings
from
django.conf
import
settings
import
md5
,
re
,
time
import
md5
,
re
,
time
,
urllib
from
openid.consumer.consumer
import
Consumer
,
\
from
openid.consumer.consumer
import
Consumer
,
\
SUCCESS
,
CANCEL
,
FAILURE
,
SETUP_NEEDED
SUCCESS
,
CANCEL
,
FAILURE
,
SETUP_NEEDED
from
openid.consumer.discover
import
DiscoveryFailure
from
openid.consumer.discover
import
DiscoveryFailure
...
@@ -67,11 +67,22 @@ def begin(request, sreg=None, extension_args=None, redirect_to=None,
...
@@ -67,11 +67,22 @@ def begin(request, sreg=None, extension_args=None, redirect_to=None,
join
=
'&'
join
=
'&'
else
:
else
:
join
=
'?'
join
=
'?'
redirect_to
+=
join
+
'next='
+
urllib
.
urlencode
(
request
.
GET
[
'next'
])
redirect_to
+=
join
+
urllib
.
urlencode
({
'next'
:
request
.
GET
[
'next'
]
})
user_url
=
request
.
POST
.
get
(
'openid_url'
,
None
)
user_url
=
request
.
POST
.
get
(
'openid_url'
,
None
)
if
not
user_url
:
if
not
user_url
:
return
render
(
'openid_signin.html'
,
{
'action'
:
request
.
path
})
request_path
=
request
.
path
if
request
.
GET
.
get
(
'next'
):
request_path
+=
'?'
+
urllib
.
urlencode
({
'next'
:
request
.
GET
[
'next'
]
})
return
render
(
'openid_signin.html'
,
{
'action'
:
request_path
,
'logo'
:
request
.
path
+
'?logo=1'
,
})
if
xri
.
identifierScheme
(
user_url
)
==
'XRI'
and
getattr
(
if
xri
.
identifierScheme
(
user_url
)
==
'XRI'
and
getattr
(
settings
,
'OPENID_DISALLOW_INAMES'
,
False
settings
,
'OPENID_DISALLOW_INAMES'
,
False
...
...
example/__init__.py
→
example
_consumer
/__init__.py
View file @
739309c5
File moved
example/manage.py
→
example
_consumer
/manage.py
View file @
739309c5
File moved
example/settings.py
→
example
_consumer
/settings.py
View file @
739309c5
...
@@ -63,7 +63,7 @@ MIDDLEWARE_CLASSES = (
...
@@ -63,7 +63,7 @@ MIDDLEWARE_CLASSES = (
'django_openidconsumer.middleware.OpenIDMiddleware'
,
'django_openidconsumer.middleware.OpenIDMiddleware'
,
)
)
ROOT_URLCONF
=
'example.urls'
ROOT_URLCONF
=
'example
_consumer
.urls'
TEMPLATE_DIRS
=
(
TEMPLATE_DIRS
=
(
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
...
...
example/urls.py
→
example
_consumer
/urls.py
View file @
739309c5
...
@@ -10,4 +10,5 @@ urlpatterns = patterns('',
...
@@ -10,4 +10,5 @@ urlpatterns = patterns('',
}),
}),
(
r'^openid/complete/$'
,
'django_openidconsumer.views.complete'
),
(
r'^openid/complete/$'
,
'django_openidconsumer.views.complete'
),
(
r'^openid/signout/$'
,
'django_openidconsumer.views.signout'
),
(
r'^openid/signout/$'
,
'django_openidconsumer.views.signout'
),
(
r'^next-works/$'
,
views
.
next_works
),
)
)
example/views.py
→
example
_consumer
/views.py
View file @
739309c5
...
@@ -25,9 +25,14 @@ def index(request):
...
@@ -25,9 +25,14 @@ def index(request):
s
.
append
(
'<a href="/openid/">Sign in with OpenID</a>'
)
s
.
append
(
'<a href="/openid/">Sign in with OpenID</a>'
)
s
.
append
(
' | <a href="/openid/with-sreg/">'
)
s
.
append
(
' | <a href="/openid/with-sreg/">'
)
s
.
append
(
'Sign in with OpenID using simple registration</a>'
)
s
.
append
(
'Sign in with OpenID using simple registration</a>'
)
s
.
append
(
' | <a href="/openid/?next=/next-works/">'
)
s
.
append
(
'Sign in with OpenID, testing ?next= param</a>'
)
if
request
.
openid
:
if
request
.
openid
:
s
.
append
(
' | <a href="/openid/signout/">Sign out</a>'
)
s
.
append
(
' | <a href="/openid/signout/">Sign out</a>'
)
s
.
append
(
'</p>'
)
s
.
append
(
'</p>'
)
return
HttpResponse
(
'
\n
'
.
join
(
s
))
return
HttpResponse
(
'
\n
'
.
join
(
s
))
def
next_works
(
request
):
return
HttpResponse
(
'?next= bit works. <a href="/">Home</a>'
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment