Integration of SAML 2.0 using OKTA into existing website.

484 views
Skip to first unread message

Kamal Kaur

unread,
Jun 1, 2021, 4:32:53 AM6/1/21
to SimpleSAMLphp
Hello Team, 

I am getting this error, please suggest something:

http://localhost/oktanew/www/module.php/saml/sp/saml2-acs.php/example-okta-com

Fatal error: Uncaught Error: Non-static method SimpleSAML\Utils\HTTP::canSetSameSiteNone() cannot be called statically in D:\xampp\htdocs\oktanew\config\config.php:581 Stack trace: #0 D:\xampp\htdocs\oktanew\lib\SimpleSAML\Configuration.php(116): require() #1 D:\xampp\htdocs\oktanew\lib\SimpleSAML\Configuration.php(273): SimpleSAML\Configuration::loadFromFile('D:\\xampp\\htdocs...', false) #2 D:\xampp\htdocs\oktanew\lib\SimpleSAML\Module.php(524): SimpleSAML\Configuration::getOptionalConfig() #3 D:\xampp\htdocs\oktanew\www\_include.php(12): SimpleSAML\Module::callHooks('exception_handl...', Object(Error)) #4 [internal function]: SimpleSAML_exception_handler(Object(Error)) #5 {main} thrown in D:\xampp\htdocs\oktanew\config\config.php on line 581

Function name : (getOptionalConfig() )

I am trying to fix this but i did not get this above mentioned function inside the configuration.php file and entire directory.
and also the error  i am getting the error which i am  unable to find inside the config/config.php file as well.

I read your directory and didn't get any solution, please provide me technicial support and suggest any possible solution.

My basic requiremnt is to intregrate the  SimpleSAMLphp   into my existing website using OKTA ->SAML 2.0.

I am integrating at both servers at localhost as well as Development Server but still getting errors one after one.

and i also checked ur refrence of github source code by using following link:
https://github.com/simplesamlphp/simplesamlphp/tree/v1.19.1.

Thankyou in advance, 
Kamal

Peter Schober

unread,
Jun 1, 2021, 5:44:08 AM6/1/21
to SimpleSAMLphp
* Kamal Kaur <kamal....@gmail.com> [2021-06-01 10:32]:
> Fatal error: Uncaught Error: Non-static method
> SimpleSAML\Utils\HTTP::canSetSameSiteNone() cannot be called statically in
> D:\xampp\htdocs\oktanew\config\config.php:581

What's the content of your config.php at line 581?
How exactly did you install SimpleSAMLphp?

-peter

Tim van Dijen

unread,
Jun 1, 2021, 7:54:24 AM6/1/21
to SimpleSAMLphp
This error is to be expected when you try and use v1.19.1 config templates mixed with a checkout from the master-branch...

Op dinsdag 1 juni 2021 om 10:32:53 UTC+2 schreef Kamal Kaur:

Kamal Kaur

unread,
Jun 2, 2021, 12:19:50 AM6/2/21
to simple...@googlegroups.com
Hello Team, 

I followed this steps for installation :

1) First of all , complete my configuration in okta like created app and got an xml file having entity Id, location url.
2) This is the main URL which I am using :

  1) Configuring the SP
  2) add my Entity Id:
 'sp1' => [
   'saml:SP',
   'entityID' => 'https://sp1.example.org/',
]

  3) Then generated two files by hit the command in cert directory:
     cd cert
     openssl req -newkey rsa:3072 -new -x509 -days 3652 -nodes -out saml.crt -keyout saml.pem

  4) then mentioned these steps in authsources.php

 'default-sp' => [
   'saml:SP',
   'privatekey' => 'cert/saml.pem',
   'certificate' => 'cert/saml.crt',
],

5) Adding IdPs to the SP like this:
 $metadata['https://dev-40934305.okta.com/oauth2/default/.well-known/oauth-authorization-server'] = [
   'SingleSignOnService'  => 'https://example.com/simplesaml/index.php',
   'SingleLogoutService'  => 'https://localhost/simplesaml/index.php',
   'certificate'          => 'saml.pem',
];


Note : this is my metadata url which i got under API option in okta
      https://dev-40934305.okta.com/oauth2/default/.well-known/oauth-authorization-server

6) add IDP as well
   idp' => 'https://idp.example.com',

7)Integrating authentication with your own application
   a)composer install and call the files
   require_once('../../lib/_autoload.php');

  b)Select authentication of sp
  $as = new \SimpleSAML\Auth\Simple('default-sp');

  c)$as->requireAuth();

 please have an look these above steps

 Thankyou in Advance,

On Wed, Jun 2, 2021 at 9:16 AM Kamal Kaur <kamal....@gmail.com> wrote:


--
This is a mailing list for users of SimpleSAMLphp, not a support service. If you are willing to buy commercial support, please take a look here:

https://simplesamlphp.org/support

Before sending your question, make sure it is related to SimpleSAMLphp, and not your web server's configuration or any other third-party software. This mailing list cannot help with software that uses SimpleSAMLphp, only regarding SimpleSAMLphp itself.

Make sure to read the documentation:

https://simplesamlphp.org/docs/stable/

If you have an issue with SimpleSAMLphp that you cannot resolve and reading the documentation doesn't help, you are more than welcome to ask here for help. Subscribe to the list and send an email with your question. However, you will be expected to comply with some minimum, common sense standards in your questions. Please read this carefully:

http://catb.org/~esr/faqs/smart-questions.html
---
You received this message because you are subscribed to a topic in the Google Groups "SimpleSAMLphp" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/simplesamlphp/jJd2GWwtItE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to simplesamlph...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simplesamlphp/20210601094403.3q7p65zg2g6o27xu%40aco.net.

Kamal Kaur

unread,
Jun 2, 2021, 2:43:52 AM6/2/21
to simple...@googlegroups.com
authsources (1).zip

Kamal Kaur

unread,
Jun 2, 2021, 3:56:12 AM6/2/21
to simple...@googlegroups.com
Hello Team, 

I followed this steps for installation :

1) First of all , complete my configuration in okta like created app and got an xml file having entity Id, location url.
2) This is the main URL which I am using :

  1) Configuring the SP
  2) add my Entity Id:
 'sp1' => [
   'saml:SP',
   'entityID' => 'https://sp1.example.org/',
]

  3) Then generated two files by hit the command in cert directory:
     cd cert
     openssl req -newkey rsa:3072 -new -x509 -days 3652 -nodes -out saml.crt -keyout saml.pem

  4) then mentioned these steps in authsources.php

 'default-sp' => [
   'saml:SP',
   'privatekey' => 'cert/saml.pem',
   'certificate' => 'cert/saml.crt',
],

5) Adding IdPs to the SP like this:

        This is main site link here
       http://oktasamltest.saasdevteam.com/login.php

      i tried at local as well and these are links
 $metadata['https://dev-40934305.okta.com/oauth2/default/.well-known/oauth-authorization-server'] = [
   'SingleSignOnService'  => 'https://example.com/simplesaml/index.php',
   'SingleLogoutService'  => 'https://localhost/simplesaml/index.php',
   'certificate'          => 'saml.pem',
];


Note : this is my metadata url which i got under API option in okta
      https://dev-40934305.okta.com/oauth2/default/.well-known/oauth-authorization-server

6) add IDP as well
   idp' => 'https://idp.example.com',

7)Integrating authentication with your own application
   a)composer install and call the files
   require_once('../../lib/_autoload.php');

  b)Select authentication of sp
  $as = new \SimpleSAML\Auth\Simple('default-sp');

  c)$as->requireAuth();

 please have an look these above steps

 Thankyou in Advance,
Attachments area

authsources (1).zip

Peter Schober

unread,
Jun 2, 2021, 5:28:35 AM6/2/21
to simple...@googlegroups.com
Kamal,

you didn't really answer any of the 2 questions I asked...

* Peter Schober <peter....@univie.ac.at> [2021-06-01 11:44]:
> * Kamal Kaur <kamal....@gmail.com> [2021-06-01 10:32]:
> > Fatal error: Uncaught Error: Non-static method
> > SimpleSAML\Utils\HTTP::canSetSameSiteNone() cannot be called statically in
> > D:\xampp\htdocs\oktanew\config\config.php:581
>
> What's the content of your config.php at line 581?
> How exactly did you install SimpleSAMLphp?

Though you attached a bunch of (confusing and partially broken, I
think) configuration files which at least confirms what line 581 looks
like. So lets concentrate on the code error you've been getting:

> a)composer install and call the files

How exactly did you install SimpleSAMLphp using composer?
What SSP version does the generated composer.lock file mention?

This is what Tim said:

* Tim van Dijen <tvd...@gmail.com> [2021-06-01 13:54]:
> This error is to be expected when you try and use v1.19.1 config
> templates mixed with a checkout from the master-branch...

So make sure you've installed the matching config for the version of
the software you're running. And you probably should be running a
tagged release, not directly from master/HEAD.

-peter

Kamal Kaur

unread,
Jun 2, 2021, 11:50:25 PM6/2/21
to simple...@googlegroups.com
Hi Peter, 

My  SSP Version is  Latest stable version (1.19.1)

  and I am getting error in config/config.php   here is the code where I am stuck, please have an look around it.

   Config file: line no 581
'session.cookie.samesite' => \SimpleSAML\Utils\HTTP::canSetSameSiteNone() ? 'None' : null,

also find the attachments as well.


  Thankyou in advance.  




--
This is a mailing list for users of SimpleSAMLphp, not a support service. If you are willing to buy commercial support, please take a look here:

https://simplesamlphp.org/support

Before sending your question, make sure it is related to SimpleSAMLphp, and not your web server's configuration or any other third-party software. This mailing list cannot help with software that uses SimpleSAMLphp, only regarding SimpleSAMLphp itself.

Make sure to read the documentation:

https://simplesamlphp.org/docs/stable/

If you have an issue with SimpleSAMLphp that you cannot resolve and reading the documentation doesn't help, you are more than welcome to ask here for help. Subscribe to the list and send an email with your question. However, you will be expected to comply with some minimum, common sense standards in your questions. Please read this carefully:

http://catb.org/~esr/faqs/smart-questions.html
---
You received this message because you are subscribed to a topic in the Google Groups "SimpleSAMLphp" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/simplesamlphp/jJd2GWwtItE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to simplesamlph...@googlegroups.com.
config.zip
composer.zip

Tim van Dijen

unread,
Jun 3, 2021, 2:26:48 AM6/3/21
to SimpleSAMLphp
Kamal,

I can tell from your composer-files that you are not running v.1.19.1, but master..  Use a tagged version!

- Tim

Op donderdag 3 juni 2021 om 05:50:25 UTC+2 schreef Kamal Kaur:

Kamal Kaur

unread,
Jun 3, 2021, 3:04:20 AM6/3/21
to simple...@googlegroups.com
What does mean I did not understand? If it's coomposer related issue then I will fix, but still did not get any soltion from your side config file 581 line error. What I am missing in config files config.php and authsources.php? Please collaborate me. Thanks
Rajandra  • 4 mins


Peter Schober

unread,
Jun 3, 2021, 8:28:03 AM6/3/21
to simple...@googlegroups.com
* Kamal Kaur <kamal....@gmail.com> [2021-06-03 09:04]:
> What does mean I did not understand? If it's coomposer related issue
> then I will fix, but still did not get any soltion from your side
> config file 581 line error.

Tim already told you, twice now:
The code you're running doesn't match your configuration.

You complain about others not helping you but you *still* have not
answered the simple question of *how* exactly you installed SSP (which
would have shown what's wrong with your composer command or config).
You don't have to provide this, of course, but then you'll have to
figure out what's wrong with it yourself.

-peter
Reply all
Reply to author
Forward
0 new messages