Showing posts with label tyk. Show all posts
Showing posts with label tyk. Show all posts
Monday, September 25, 2017
Tyk with Apache Directory Studio
Tyk with Apache Directory Studio
So I was getting all sort of weird errors due to mismatch in the dn. Then we decided to switch to Apache Directory Studio from OpenLDAP, as it is more user-friendly. Finally, I got Tyk configured with LDAP, thanks to Apache Directory Studio.
First, I had to configure the profiles.json of Tyk.
[{
"ActionType": "GenerateOrLoginUserProfile",
"ID": "4",
"OrgID": "573cb5c7a57xxxdeb1f78000001",
"ProviderConfig": {
"FailureRedirect": "http://dashboard.tyk-local.com:3000/?fail=true",
"LDAPAttributes": [],
"LDAPPort": "10389",
"LDAPServer": "localhost",
"LDAPUserDN": "cn=*USERNAME*,ou=people,dc=sharmalab,dc=bmi,dc=emory,dc=edu"
},
"ProviderName": "ADProvider",
"ReturnURL": "http://dashboard.tyk-local.com:3000/tap",
"Type": "passthrough"
}
]
and also tib.conf, reflecting the ports and all.
{
"Secret": "934893845123491xxx238192381486djfhr87234827348",
"HttpServerOptions": {
"UseSSL": false,
"CertFile": "./certs/server.pem",
"KeyFile": "./certs/server.key"
},
"BackEnd": {
"Name": "in_memory",
"ProfileBackendSettings": {},
"IdentityBackendSettings": {
"Hosts" : {
"localhost": "6379"
},
"Password": "",
"Database": 0,
"EnableCluster": false,
"MaxIdle": 1000,
"MaxActive": 2000
}
},
"TykAPISettings": {
"GatewayConfig": {
"Endpoint": "http://dashboard.tyk-local.com",
"Port": "8080",
"AdminSecret": "54321"
},
"DashboardConfig": {
"Endpoint": "http://dashboard.tyk-local.com",
"Port": "3000",
"AdminSecret": "12345"
}
}
}
Finally, I was able to send a POST request to http://localhost:3010/auth/4/ldap?username=pradeeban&password=34%$%$4w33
INFO[0008] [AD AUTH] User bind successful: pradeeban
INFO[0008] [TYK ID HANDLER] Creating identity for: {map[] ADProvider pradeeban@ADProvider pradeeban }
download file now
Wednesday, September 6, 2017
Tyk Dashboard crashed after setting the portal domain
Tyk Dashboard crashed after setting the portal domain
So I set the portal domain to be as the same with the dashboard. Later, I was instructed that it is not permitted to have the portal domain same as the dashboard.
However, now I am left with the below error which does not simply disappear when I reconfigure Tyk.
panic: http: multiple registrations for dashboard.tyk-local.com:3000/
goroutine 1 [running]:
panic(0xa60f80, 0xc820370be0)
/usr/local/go/src/runtime/panic.go:464 +0x3e6
net/http.(*ServeMux).Handle(0xc820356d50, 0xc82036f7e0, 0x1d, 0x7f5a221595d8, 0xc82027af20)
/usr/local/go/src/net/http/server.go:1926 +0x297
main.GenerateRoutes()
/home/tyk/go/src/github.com/lonelycode/tyk-analytics/Main.go:733 +0x41b7
main.main()
/home/tyk/go/src/github.com/lonelycode/tyk-analytics/Main.go:750 +0x59
I basically had to drop the Mongo table, and then reconfigure Tyk to get everything back in place.
In Mongo shell:
> use tyk_analytics
switched to db tyk_analytics
> db.dropDatabase();
{ "dropped" : "tyk_analytics", "ok" : 1 }
download file now
Saturday, August 26, 2017
Tyk 2 0 in Centos
Tyk 2 0 in Centos
There are some minor changes in setting up Tyk 1.9 and Tyk 2.0, and also some differences between setting up on Ubuntu vs Centos.
Installing Tyk 2.0 on Centos is described here.
sudo /opt/tyk-gateway/install/setup.sh --dashboard=http://lion.bmi.emory.edu:3000 --listenport=8080 --redishost=localhost --redisport=6379 --domain=""
sudo /opt/tyk-dashboard/install/setup.sh --listenport=3000 --redishost=localhost --redisport=6379 --mongo=mongodb://127.0.0.1/tyk_analytics --tyk_api_hostname=localhost --tyk_node_hostname=http://localhost --tyk_node_port=8080 --portal_root=/portal --domain="lion.bmi.emory.edu"
sudo /opt/tyk-pump/install/setup.sh --redishost=localhost --redisport=6379 --mongo=mongodb://127.0.0.1/tyk_analytics
sudo service tyk-pump start
sudo service tyk-dashboard start
http://lion.bmi.emory.edu:3000/
sudo service tyk-dashboard restart
sudo service tyk-gateway start
sudo /opt/tyk-dashboard/install/bootstrap.sh lion.bmi.emory.edu
sudo /opt/tyk-dashboard/install/setup.sh --listenport=3000 --redishost=localhost --redisport=6379 --mongo=mongodb://127.0.0.1/tyk_analytics --tyk_api_hostname=localhost --tyk_node_hostname=http://localhost --tyk_node_port=8080 --portal_root=/portal --domain="lion.bmi.emory.edu"
sudo /opt/tyk-pump/install/setup.sh --redishost=localhost --redisport=6379 --mongo=mongodb://127.0.0.1/tyk_analytics
sudo service tyk-pump start
sudo service tyk-dashboard start
http://lion.bmi.emory.edu:3000/
sudo service tyk-dashboard restart
sudo service tyk-gateway start
sudo /opt/tyk-dashboard/install/bootstrap.sh lion.bmi.emory.edu
download file now
Subscribe to:
Posts (Atom)