Moodle 3.5.1
plugin auth_saml2sso_moodle35_2018051500.zip
Question:
I guess I have the same error as Naaman Fallouh at https://moodle.org/plugins/auth_saml2sso (comments page 2)
I am able to login with phpBB/SAML and have
http://moodle.localhost/
and
http://moodle.localhost/simplesaml
I am able to login using http://moodle.localhost/simplesaml
I am able to login using http://moodle.localhost/ but after the login I get stuck in a loop:
http://saml_idp.localhost/simplesaml/saml2/idp/SSOService.php?SAMLRequest=chars&RelayState=http%3A%2F%2Fmoodle.localhost%2Flogin%2Findex.php
(saml_idp.localhost is indeed my idp)
Over and over again, with every time other value for chars.
I did set in http://moodle.localhost/simplesaml/config/config.php
'session.phpsession.cookiename' => 'MoodleSession',
That is the only difference from the
phpbb3.localhost/simplesaml/config/config.php.
What else could be wrong? What's your first thought I should look at?
I use the example userpass authentication and defined a user like so:
'admin:admin' => array(
'urn:oid:0.9.2342.19200300.100.1.1' => array('admin'),
'idnumber'=> array('123'),
'email' => array('email#admin.nl'),
'firstname' => array('firstadmin'),
'lastname' => array('lastadmin'),
"phone1" => array('admin'),
"phone2" => array('admin'),
"department" => array('admin'),
"address" => array('admin'),
"city" => array('admin'),
"country" => array('admin'),
"description" => array('admin'),
"idnumber" => array('admin'),
"lang" => array('admin'),
"guid" => array('admin'),
'urn:oid:1.3.6.1.4.1.5923.1.1.1.1' => array('globaladministrators'),
),
In Moodle the plugin configuration I set
Username attribute to: urn:oid:0.9.2342.19200300.100.1.1
Would that not be enough?
Fixed by using sql for session.
Related
We began seeing these DocuSign exceptions 09/24/2019:
DocuSign \ eSign \ ApiException (401)
[401] Error connecting to the API (https://NA3.docusign.net/restapi/v2/login_information)
None of the code surrounding our DocuSign logic has been touched for almost six months. So I'm at a loss as to why this exception is being thrown.
We're using the following packages (relating to this):
laravel/framework v5.8.35
docusign/esign-client 3.0.1
tucker-eric/docusign-rest-client 1.0.0
tucker-eric/laravel-docusign 0.1.1
I've tried to update the packages with composer thinking they might have made updates to fix something, but it didn't change anything other than throw USER_AUTHENTICATION_FAILED instead of the exceptions' message above.
As I said, no code has been touched, and I have very little experience with the DocuSign API, and making matters worse this was an old developer's code...
I am able to hit the endpoint, and authenticate with our credentials, using Postman and it seems to work fine. So again, I'm not sure how this just started happening.
The code from our controller:
$parcel = request('parcel_id');
$subdivision = $user->subdivision_id;
$subEmail = Subdivision::where('id', $user->subdivision_id)->pluck('email')->first();
$move = Move::create([
'full_name' => request('full_name'),
'email' => request('email'),
'phone_number' => request('phone_number'),
'parcel_id' => $parcel,
'direction' => request('direction'),
'action_date' => request('action_date'),
'user_id' => auth()->id(),
'subdivision_id' => $subdivision
]);
$residentTabs = array(
array(
'tabLabel' => env('MOVE_IN_ADDRESS_FIELD'),
'value' => $move->parcel->MailingAddress
),
array(
'tabLabel' => env('MOVE_IN_DATE_RESIDENT_FIELD'),
'value' => $move->action_date->format('m/d/Y')
),
array(
'tabLabel' => env('MOVE_IN_EMAIL_FIELD'),
'value' => $move->email
),
array(
'tabLabel' => env('MOVE_IN_PRIMARY_PHONE_FIELD'),
'value' => $move->phone_number
),
array(
'tabLabel' => env('MOVE_IN_FULL_NAME_FIELD'),
'value' => $move->full_name
)
);
$pmTabs = array(
array(
'tabLabel' => env('MOVE_IN_PM_ADDRESS_FIELD'),
'value' => $move->parcel->MailingAddress
),
array(
'tabLabel' => env('MOVE_IN_PM_DATE_FIELD'),
'value' => $move->action_date->format('m/d/Y')
),
);
$templateRoles = array(
array(
'email' => $move->email,
'name' => $move->full_name,
'roleName' => 'Resident',
'tabs' => array(
'textTabs' => $residentTabs
)
),
array(
'email' => $subEmail,
'name' => $user->name,
'roleName' => 'Property Manager',
'tabs' => array(
'textTabs' => $pmTabs
)
)
);
$envelopeDefinition = array(
'status' => 'sent',
'templateId' => env("DOCUSIGN_TEMPLATE_ID"),
'templateRoles' => $templateRoles
);
$contract = DocuSign::get('envelopes')->createEnvelope($envelopeDefinition);
The last line is where the exception is thrown, and the function throwing the exceptions is:
vendor/docusign/esign-client/src/ApiClient.php::callApi
We expect it to work as it has, throwing no exceptions and creating the envelope successfully.
However, we have been seeing USER_AUTHENTICATION_FAILED and general 401 exceptions.
Any help is appreciated!
Your token may have expired. Not sure how it was created and what authentication mechanism you are using. You need to check where is the token and the header in the REST API calls that is using it. It may be that was hardcoded, or was there a refresh token used to keep obtaining new tokens and that process broke.
If you're getting an Authentication failure while trying to hit the login_information endpoint, it's likely that your application is using Legacy Header authentication with an invalid password.
I'd recommend the following:
Try to log in to the web console at www.docusign.net, and perform a Password Reset if necessary
Once you are able to log in, update the stored credentials in the application
2FA or forced Single Sign-On will both block Legacy Header auth. If either is in place, they will need to be disabled, or you will need to switch to one of the Account Server auth workflows.
Whenever i got an error in yii2 application it shows session and cookie information.
$_COOKIE = [
'advanced-backend' => 'd9ao5cmemmnte4epb69mkuore1',
'_identity-backend' => '9f1de7abef3bcb3b520d1a6caa06defc181307c5f227cb3bf06477428d021366a:2:{i:0;s:17:"_identity-backend";i:1;s:16:"[51,144,2592000]";}',
];
$_SESSION = [
'__flash' => [],
'__returnUrl' => '/oms/',
'UserID' => '51',
'UserName' => 'alesh#example.com.np',
'FullName' => 'Alesh',
'EmployeeID' => '53',
'RoleID' => '423',
'SupervisorID' => '342',
'SupervisorName' => 'USER',
'Menus' => 'leave,attendance,dailyreport,myinfo',
'Role' => 'employee',
'__id' => 51,
'__expire' => 1520506157,
];
as this cant be secure to show these things to user how to hide or remove these things when user get an error??
In home directory of your project, you have a index.php file, just need to change first and second line of this file to :
defined('YII_DEBUG') or define('YII_DEBUG', false);
defined('YII_ENV') or define('YII_ENV', 'prod');
this change, can change your project to production mode and hide any error of your site, but error stored in project_root\runtime\logs
I have configured an identification provider (IdP) part of a SSO system, using SimpleSAMLphp.
The main sections of my configuration files:
config/config.php
$config = array(
[...]
'enable.saml20-idp' => true,
'enable.shib13-idp' => true,
[...]
);
config/authsources.php
$config = array(
[...]
'*-sql' => array(
'sqlauth:SQL',
'dsn' => 'mysql:host=*.*.*.*;port=*;dbname=*',
'username' => '*',
'password' => '*',
'query' => 'SELECT *
FROM users
WHERE username = *
AND password = *',
),
[...]
);
metadata/saml20-idp-hosted.php
$metadata['__DYNAMIC:1__'] = array(
'host' => '__DEFAULT__',
'privatekey' => '../cert/*.key',
'certificate' => '../cert/*.pem',
'auth' => '*-sql',
'NameIDFormat' => 'urn:oasis:names:tc:SAML:2.0:nameid-format:persistent',
'authproc' => array(
3 => array(
'class' => 'saml:AttributeNameID',
'attribute' => 'uid',
'Format' => 'urn:oasis:names:tc:SAML:2.0:nameid-format:persistent',
),
),
);
metadata/saml20-idp-remote.php
$metadata['https://www.video2brain.com/shibboleth'] = array(
'AssertionConsumerService' => 'http://*/Shibboleth.sso/SAML2/POST',
'SingleSignOnService' => 'http://*/Shibboleth.sso/SAML2/POST',
'SingleLogoutService' => 'http://*/Shibboleth.sso/SLO/POST',
);
The certificates and metadata were successfully configurated. The SSO works fine.
But the service provider (SP) has requested that the IdP has to pass more info of the logged user. The authentication is passed when the query returns a row, but i can't access to the fields in the SELECT.
Currently, the final POST request that my IdP sent to their SP has the following parameters:
HTTP_SHIB_IDENTITY_PROVIDER=https://*/metadata.php,
HTTP_SHIB_AUTHENTICATION_INSTANT=2015-10-20T09:04:42Z,
HTTP_SHIB_AUTHENTICATION_METHOD=urn:oasis:names:tc:SAML:2.0:ac:classes:Password,
HTTP_SHIB_AUTHNCONTEXT_CLASS=urn:oasis:names:tc:SAML:2.0:ac:classes:Password,
HTTP_EMAIL=*#*.*,
HTTP_PERSISTENT_ID=!https://*/shibboleth-sp!6faa919dda0e40e5e42088bcd9beb639ed4dfa5e
And they want the full name of the user in a new parameter. Something like that:
[...]
HTTP_USER_NAME=FooUserName
I have tried using the "Adding attributes (core:AttributeAdd)" method but doesn't work. Is possible do that? Any doc, resource or example for this will be helpful.
Thanks.
I set the parameter as "givenName" instead of "name", and it works!
In the auth query, I put an alias for the user "name" as "givenName".
In the idp-hosted, in the "authproc" key I used de AttributeMap method to add the "givenName".
I did these things before, but I was trying to use "name" as the final parameter "name", and didn't work until I use "givenName".
Someone could say me why?
The parameter name is no configurable?
May be the SP and the IdP has to configure the same name in both sides?
I am working on project in which I need to use DocuSign API (PHP). This is my first experience with DocuSign and I successfully made template in DocuSign Console with roleName = signer. There I also made Custom Text Tags: address, city, state and phone and drag them to the desired location in my template. I want there to put my customer (signer) information from project database.
From my project I successfully made connection with DocuSign via PHP API and receive Embedded Singing View URL which opens my template where the user can sign document without problem.
But... all my custom text tags are empty and signer can type into them. I need to pre-fill them with signer personal data which is coming from database. I triple check custom tag label spelling, upper/lower case in my DocuSign Console and in my code as well as roleName->tagLabel relation. My PHP code is below.
Can someone, please, tell me what I am doing wrong?
I lost two days on it.
$data = array(
"accountId" => $accountId,
"emailSubject" => $this->_emailSubject,
"templateId" => $templateId,
"templateRoles" => array(
array(
"email" => $email,
"name" => $recipientName,
"clientUserId" => $clientUserId,
"roleName" => "signer",
"customFields" => array(
"textCustomFields" => array (
array (
"name" => "address",
"value" => "Address from DB",
"show" => "true",
),
array (
"name" => "city",
"value" => "City from DB",
"show" => "true",
),
array (
"name" => "state",
"value" => "State from DB",
"show" => "true",
),
array (
"name" => "phone",
"value" => "Phone from DB",
"show" => "true",
),
),
),
),
),
"status" => "sent"
);
You need to use the textTabs type in your JSON, not customFields which is used for something else. For instance, if you drag a Data Field from the UI onto the document and give it name address, to pre-fill that field you would need to reference it's tabLabel and value fields like this:
"roleName" => "signer",
"tabs" => array(
"textTabs" => array(
array(
"tabLabel"=> "address",
"value" => "123 Main St."
)
)
)
Can anyone explain how to use the AWS PHP SDK to log the metric in the style like the above screen.
I use the following PHP code but the select menu is showing "ELB: AvaliabiltyZone", how to make it show "Aggregated by AvaliabiltyZone"? What is the logic used here?
$response = $cw->put_metric_data("ELB", array(
array(
"MetricName" => "Latency",
"Dimensions" => array(
array("Name" => "AvaliabiltyZone" , "Value" => "us-east-1c")
),
"Timestamp" => "now",
"Value" => 1,
"Unit" => "None"
),
));
AvaliabiltyZone
You misspelled "AvailabilityZone"
This maybe won't answer the question, but it might fix some things...
$cw = new AmazonCloudWatch();
$cw->set_region('monitoring.'.$region.'amazonaws.com');
$res1 = $CW->put_metric_data('Sys/RDS' ,
array(array('MetricName' => 'Uptime' ,
'Dimensions' => array(array('Name' => 'AvaliabiltyZone',
'Value' => 'us-east-1c')),
'Value' => $Uptime,
'Unit' => 'Seconds')));
Click Here