Skip to content

Commit c528f3c

Browse files
authored
Merge pull request #135 from solid/revert-134-133
Revert "Solves #133: add client_name, logo_uri and contacts fields to client …"
2 parents 2009db9 + 093fa22 commit c528f3c

File tree

4 files changed

+5
-80
lines changed

4 files changed

+5
-80
lines changed

README.md

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -155,31 +155,6 @@ and emits the following events:
155155
- `logout ()` when a user logs out
156156
- `session (session: Session | null)` when a user logs in or out
157157

158-
### Client registration
159-
160-
`SolidAuthClient` automatically registers your OIDC client application if it is
161-
unknown to the authorization server, following
162-
[the registration request spec](https://openid.net/specs/openid-connect-registration-1_0.html#RegistrationRequest).
163-
164-
You can specify some fields of this registration request by passing them to the
165-
`loginSession` parameter of `solid.auth.login`.
166-
167-
Supported fields are:
168-
169-
* `client_name` and internationalized variants (`clientName` property)
170-
* `contacts` (`contacts` property)
171-
* `logo_uri` (`contacts` property)
172-
173-
**Example**:
174-
175-
```js
176-
solid.auth.login(idp, {
177-
clientName: 'My Example',
178-
'clientName#ja-Jpan-JP': 'クライアント名',
179-
logoUri: 'https://client.example.org/logo.png',
180-
contacts: ['ve7jtb@example.org', 'mary@example.org']
181-
})
182-
````
183158

184159
## Advanced usage
185160

src/__test__/solid-auth-client.spec.js

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -195,36 +195,6 @@ describe('login', () => {
195195
expect(location.searchParams.get('scope')).toEqual('openid')
196196
expect(location.searchParams.get('client_id')).toEqual('the-client-id')
197197
})
198-
199-
it('performs the client registration the the correct provided registration parameters', async () => {
200-
let requestBody = {}
201-
nock('https://localhost/')
202-
.get('/.well-known/openid-configuration')
203-
.reply(200, oidcConfiguration)
204-
.get('/jwks')
205-
.reply(200, jwks)
206-
.post('/register', body => {
207-
requestBody = body
208-
return true
209-
})
210-
.reply(200, oidcRegistration)
211-
212-
await instance.login('https://localhost', {
213-
clientName: 'My Example',
214-
'clientName#ja-Jpan-JP': 'クライアント名',
215-
logoUri: 'https://client.example.org/logo.png',
216-
contacts: ['ve7jtb@example.org', 'mary@example.org']
217-
})
218-
219-
expect(requestBody).toMatchObject({
220-
client_name: 'My Example',
221-
'client_name#ja-Jpan-JP': 'クライアント名',
222-
contacts: ['ve7jtb@example.org', 'mary@example.org'],
223-
logo_uri: 'https://client.example.org/logo.png'
224-
})
225-
226-
expect.assertions(1)
227-
})
228198
})
229199
})
230200

src/solid-auth-client.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ const globalFetch = fetch
1515

1616
export type loginOptions = {
1717
callbackUri: string,
18-
clientName?: string,
19-
contacts?: Array<string>,
20-
logoUri?: string,
2118
popupUri: string,
2219
storage: AsyncStorage
2320
}

src/webid-oidc.js

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -125,34 +125,18 @@ async function storeRp(
125125
return rp
126126
}
127127

128-
function registerRp(idp: string, opts: loginOptions): Promise<RelyingParty> {
129-
const { storage, callbackUri } = opts
128+
function registerRp(
129+
idp: string,
130+
{ storage, callbackUri }: loginOptions
131+
): Promise<RelyingParty> {
130132
const responseType = 'id_token token'
131-
132-
const clientNameI18n = {}
133-
Object.entries(opts)
134-
.filter(([key, _]) => key.startsWith('clientName#'))
135-
.forEach(
136-
([key, value]) =>
137-
(clientNameI18n[key.replace('clientName#', 'client_name#')] = value)
138-
)
139-
140-
const supplementaryOptions = {
141-
logo_uri: opts.logoUri,
142-
contacts: opts.contacts,
143-
client_name: opts.clientName
144-
}
145-
146133
const registration = {
147134
issuer: idp,
148135
grant_types: ['implicit'],
149136
redirect_uris: [callbackUri],
150137
response_types: [responseType],
151-
scope: 'openid profile',
152-
...clientNameI18n,
153-
...supplementaryOptions
138+
scope: 'openid profile'
154139
}
155-
156140
const options = {
157141
defaults: {
158142
authenticate: {
@@ -162,7 +146,6 @@ function registerRp(idp: string, opts: loginOptions): Promise<RelyingParty> {
162146
},
163147
store: storage
164148
}
165-
166149
return RelyingParty.register(idp, registration, options)
167150
}
168151

0 commit comments

Comments
 (0)