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: README.md
+57-52Lines changed: 57 additions & 52 deletions
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,7 @@ SolidusSocial
6
6
7
7
Social login support for Solidus. Solidus Social handles authorization, account
8
8
creation and association through third-party services.
9
-
Currently Google, Facebook, Github and X (formely Twitter) are available out of the box.
10
-
Support for Apple ID and Microsoft (Entra and O365) might be offered down the road.
9
+
Currently Facebook, Github and Google OAuth2 are available out of the box.
11
10
12
11
Installation
13
12
------------
@@ -26,15 +25,12 @@ bundle exec rails g solidus_social:install
26
25
bundle exec rails db:migrate
27
26
```
28
27
29
-
Preference(optional): By default the login path will be `/users/auth/:provider`. If you wish to modify the url to:
30
-
`/member/auth/:provider`, `/profile/auth/:provider`, or `/auth/:provider` then you can do this accordingly in
31
-
your **config/initializers/spree.rb** file as described below:
28
+
This will install a new initializer `config/initializers/solidus_social.rb` into
29
+
your project that allows you to setup the services you want configured for your app.
30
+
31
+
Optional: By default the login path will be '/users/auth/:provider'. If you
32
+
want something else, configure it in `config/initializers/solidus_social.rb`.
32
33
33
-
```ruby
34
-
Spree::SocialConfig[:path_prefix] ='member'# for /member/auth/:provider
35
-
Spree::SocialConfig[:path_prefix] ='profile'# for /profile/auth/:provider
36
-
Spree::SocialConfig[:path_prefix] =''# for /auth/:provider
37
-
```
38
34
39
35
Using OAuth Sources
40
36
-------------------
@@ -43,29 +39,12 @@ Login as an admin user and navigate to Configuration > Social Authentication Met
43
39
44
40
Click "New Authentication Method" and choose one of your configured providers.
45
41
46
-
Click on the New Authentication Method button to enter the key obtained from their respective source, (See below for instructions on setting up the various providers).
47
-
48
-
Multiple key entries can now be entered based on the rails environment. This allows for portability and the lack of need to check in your key to your repository. You also have the ability to enable and disable sources. These setting will be reflected on the client UI as well.
49
-
50
-
Alternatively you can ship keys as environment variables and create these Authentication Method records on application boot via an initializer. Below is an example for facebook.
51
-
52
-
```ruby
53
-
# Ensure our environment is bootstrapped with a facebook connect app
**You MUST restart your application after configuring or updating an authentication method.**
64
43
65
44
Registering Your Application
66
45
----------------------------
67
46
68
-
OAuth Applications @ Facebook, Twitter, Google and / or Github are supported out of the
47
+
Facebook, Github and Google OAuth2 are supported out of the
69
48
box but, you will need to register your application with each of the sites you
70
49
want to use.
71
50
@@ -107,46 +86,72 @@ Make sure you specifity the right IP address.
107
86
108
87
> More info: [https://developers.google.com/identity/protocols/OAuth2](https://developers.google.com/identity/protocols/OAuth2)
109
88
110
-
### Twitter
111
-
[Twitter / Application Management / Create an application](https://docs.x.com/resources/fundamentals/authentication/oauth-2-0/overview)
89
+
### Other OAuth Providers
112
90
113
-
1. Name and Description must be filled in with something
114
-
2. Configure user authentication setting with:
115
-
- App permissions: Read (default) and enable Request email from users option.
116
-
- Application Website: http://your_computer.local:3000 for development / http://your-site.com for production
117
-
- Application Type: Web App, Automated App or Bot
118
-
- Callback URL: http://your_computer.local:3000 for development / http://your-site.com for production
119
-
3. Save Application
91
+
Other OAuth providers are supported, given that there is an [OmniAuth
92
+
strategy][12] for them. (If there isn't, you can [write one][13].)
120
93
121
-
###Adding other OAuth sources
94
+
#### LinkedIn Example
122
95
123
-
It is easy to add any OAuth source, given there is an OmniAuth strategy gem for it (and if not, you can easily write one by yourself). For instance, if you want to add authorization via LinkedIn, the steps will be:
124
-
1. Add gem `"omniauth-linkedin"` to your Gemfile, run `bundle install`.
125
-
2. In an initializer file, e.g. `config/initializers/devise.rb`, add and init a new provider for SolidusSocial:
96
+
1. Add `gem "omniauth-linkedin"`to your Gemfile and run `bundle install`.
97
+
2. In `config/initializers/solidus_social.rb` add and initialize a new provider
98
+
for SolidusSocial:
126
99
127
-
**Optional:** If you want to skip the sign up phase where the user has to provide an email and a password, add a third parameter to the provider entry and the Spree user will be created directly using the email field in the [Auth Hash Schema](https://github.com/omniauth/omniauth/wiki/Auth-Hash-Schema):
Notice: APPLE_PRIVATE_KEY should consist from one-line p8-file content, like this `'\n-----BEGIN PRIVATE KEY-----\nsecret\n-----END PRIVATE KEY-----\n'`
150
+
146
151
Documentation
147
152
-------------
148
153
149
-
API documentation is available [on RubyDoc.info][13].
154
+
API documentation is available [on RubyDoc.info][15].
0 commit comments