Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
policy
Manage
Activity
Members
Labels
Plan
Issues
4
Issue boards
Milestones
Wiki
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gaia-X
Trust Services API
policy
Commits
1d14d8d9
Commit
1d14d8d9
authored
2 years ago
by
Yordan Kinkov
Browse files
Options
Downloads
Patches
Plain Diff
Passwordless login extension functions documentation
parent
990e7beb
No related branches found
No related tags found
1 merge request
!38
Rego extension function documentation
Pipeline
#52965
passed with stages
in 1 minute and 18 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/policy_development.md
+68
-0
68 additions, 0 deletions
doc/policy_development.md
with
68 additions
and
0 deletions
doc/policy_development.md
+
68
−
0
View file @
1d14d8d9
...
...
@@ -310,3 +310,71 @@ Result:
"valid"
:
true
}
```
#### ocm.getLoginProofInvitation
Get a Proof Invitation URL from OCM's "out-of-band" endpoint.
This function accepts two arguments. The first argument is an array of scopes used to identify
credential types in OCM. The second argument is a map between scopes and credential types
which is statically defined in a
`data.json`
file.
Example request body:
```
json
{
"scope"
:
[
"openid"
,
"email"
]
}
```
Example
`data.json`
file containing "scope-to-credential-type" map:
```
json
{
"scopes"
:
{
"openid"
:
"principalMemberCredential"
,
"email"
:
"universityCert"
}
}
```
Example policy:
```
rego
package
example
.
GetLoginProofInvitation
_
=
ocm
.
getLoginProofInvitation
(
input
.
scope
,
data
.
scopes
)
```
Result:
```
json
{
"link"
:
"https://ocm:443/didcomm/?d_m=eyJAdHlwZSI6Imh0dHBzOi8vZGlkY29tbS5vc9tbSJ9fQ"
,
"requestId"
:
"851076fa-da78-444a-9127-e636c5102f40"
}
```
#### ocm.GetLoginProofResult
Get a Proof Invitation result from OCM containing a flattened list of claims.
This function accepts one argument which is the
`resuestId`
from the
`ocm.getLoginProofInvitation`
result.
Example policy:
```
rego
package
example
.
GetLoginProofResult
_
=
ocm
.
getLoginProofResult
(
input
.
requestId
)
```
Result:
```
json
{
"name"
:
"John Doe"
,
"given_name"
:
"John"
,
"family_name"
:
"Doe"
,
"email"
:
"example@example.com"
,
"email_verified"
:
true
,
"preferred_username"
:
"john"
,
"gender"
:
"NA"
}
```
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment