You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/guides/basics-of-authentication.md
+7-4Lines changed: 7 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,9 @@ title: Basics of Authentication | GitHub API
4
4
5
5
# Basics of Authentication
6
6
7
+
* TOC
8
+
{:toc}
9
+
7
10
In this section, we're going to focus on the basics of authentication. Specifically,
8
11
we're going to create a Ruby server (using [Sinatra][Sinatra]) that implements the [web flow][webflow] of an application in several different ways.
9
12
@@ -49,7 +52,7 @@ Next, in _views/index.erb_, paste this content:
49
52
</head>
50
53
<body>
51
54
<p>Well, hello there!</p>
52
-
<p>We're going to now talk to the GitHub API. Ready? <a href="https://github.com/login/oauth/authorize?client_id=<%= client_id %>">Click here</a> to begin!</a></p>
55
+
<p>We're going to now talk to the GitHub API. Ready? <a href="https://github.com/login/oauth/authorize?client_id=<%= client_id %>">Click here</a> to begin!</a></p>
53
56
<p>If that link doesn't work, remember to provide your own <a href="http://developer.github.com/v3/oauth/#web-application-flow">Client ID</a>!</p>
54
57
</body>
55
58
</html>
@@ -100,10 +103,10 @@ We can do whatever we want with our results. In this case, we'll just dump them
100
103
101
104
<p>Okay, here's a JSON dump:</p>
102
105
<p>
103
-
<p>Hello, <%= login %>! It looks like you're <%= hire_status %>.</p>
106
+
<p>Hello, <%= login %>! It looks like you're <%= hire_status %>.</p>
104
107
</p>
105
108
106
-
## Adding permanent authentication
109
+
## Implementing "persistent" authentication
107
110
108
111
It'd be a pretty bad model if we required users to log into the app every single
109
112
time they needed to access the web page. For example, try navigating directly to
@@ -194,7 +197,7 @@ Now, create a file in _views_ called _advanced.erb_, and paste this markup into
194
197
<head>
195
198
</head>
196
199
<body>
197
-
<p>Well, well, well, <%= login %>! It looks like you're <em>still</em> <%= hire_status %>!</p>
200
+
<p>Well, well, well, <%= login %>! It looks like you're <em>still</em> <%= hire_status %>!</p>
0 commit comments