xo::Authorize method get_required_fields (protected)

 <instance of xo::Authorize[i]> get_required_fields -claims claims  \
    -mapped_fields mapped_fields 

Defined in packages/xooauth/tcl/authorize-procs.tcl

Check, if required fields are provided in the claims and perform the name mapping between what was provided from the identity provided and what we need in OpenACS.

Switches:
-claims (required)
-mapped_fields (required)

Testcases:
No testcase defined.
Source code:
set result ""

set fields {}
foreach pair $mapped_fields {
    lassign $pair field target
    if {[dict exists $claims $field]} {
        dict set fields $target [dict get $claims $field]
    }
}
dict set result fields $fields
foreach field [:required_fields] {
    if {![dict exists $fields $field]
        || [dict get $fields $field] in {"" "null"}
    } {
        set not_enough_data $field
        break
    }
}

if {[info exists not_enough_data]} {
    ns_log warning "[self] get_user_data: not enough data:"  $not_enough_data "is missing"  "($field -> $target, claims: $claims)"
    dict set result error oacs-not_enough_data
}
return $result
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: